<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>pattern - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />

<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>

<body>

<header>

<div class="header">
  <a href="http://vim-jp.org/">vim-jp</a>
  / <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
  / pattern<br />
  <a name="top"></a><h1>pattern - Vim Documentation</h1>
  <a href="index.html">Return to main</a>

  <span class="EnglishJapaneseLink">
    <span class="CurrentLanguage">English</span>
  </span>
</div>
</header>

<nav>
<dl>

<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>

<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>

<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>

<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>

<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>

<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>

<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>

<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>

<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>

<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>

<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>

<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>

<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>

<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>

<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>

<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>

<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>

</dl>
</nav>

<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="pattern.html" name="pattern.txt">pattern.txt</a>&nbsp;&nbsp; For&nbsp;<span class="Identifier">Vim version 8.0.</span>&nbsp;&nbsp;Last change: 2017 Jun 05<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Identifier">VIM REFERENCE MANUAL&nbsp;&nbsp;&nbsp;&nbsp;by Bram Moolenaar</span><br>
<br>
<br>
Patterns and search commands&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#pattern-searches" name="pattern-searches">pattern-searches</a><br>
<br>
The very basics can be found in section&nbsp;<a class="Identifier" href="usr_03.html#03.9">03.9</a>&nbsp;of the user manual.&nbsp;&nbsp;A few more<br>
explanations are in chapter 27&nbsp;<a class="Identifier" href="usr_27.html">usr_27.txt</a>.<br>
<br>
1. Search commands&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#search-commands">search-commands</a><br>
2. The definition of a pattern&nbsp;&nbsp;<a class="Identifier" href="pattern.html#search-pattern">search-pattern</a><br>
3. Magic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/magic">/magic</a><br>
4. Overview of pattern items&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#pattern-overview">pattern-overview</a><br>
5. Multi items&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#pattern-multi-items">pattern-multi-items</a><br>
6. Ordinary atoms&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#pattern-atoms">pattern-atoms</a><br>
7. Ignoring case in a pattern&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/ignorecase">/ignorecase</a><br>
8. Composing characters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#patterns-composing">patterns-composing</a><br>
9. Compare with Perl patterns&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#perl-patterns">perl-patterns</a><br>
10. Highlighting matches&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#match-highlight">match-highlight</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Search commands&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#search-commands" name="search-commands">search-commands</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/" name="/">/</a><br>
/<span class="Special">{pattern}</span>[/]<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Search forward for the&nbsp;<span class="Special">[count]</span>'th occurrence of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{pattern}</span>&nbsp;<a class="Identifier" href="motion.html#exclusive">exclusive</a>.<br>
<br>
/<span class="Special">{pattern}</span>/<span class="Special">{offset}&lt;CR&gt;</span>&nbsp;Search forward for the&nbsp;<span class="Special">[count]</span>'th occurrence of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{pattern}</span>&nbsp;and go&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>&nbsp;lines up or down.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="motion.html#linewise">linewise</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/<CR>" name="/&lt;CR&gt;">/&lt;CR&gt;</a><br>
/<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Search forward for the&nbsp;<span class="Special">[count]</span>'th occurrence of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latest used pattern&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;with latest used<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>.<br>
<br>
//<span class="Special">{offset}&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Search forward for the&nbsp;<span class="Special">[count]</span>'th occurrence of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latest used pattern&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;with new<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>.&nbsp;&nbsp;If&nbsp;<span class="Special">{offset}</span>&nbsp;is empty no offset is used.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#?" name="?">?</a><br>
?<span class="Special">{pattern}</span>[?]<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Search backward for the&nbsp;<span class="Special">[count]</span>'th previous<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;occurrence of&nbsp;<span class="Special">{pattern}</span>&nbsp;<a class="Identifier" href="motion.html#exclusive">exclusive</a>.<br>
<br>
?<span class="Special">{pattern}</span>?<span class="Special">{offset}&lt;CR&gt;</span>&nbsp;Search backward for the&nbsp;<span class="Special">[count]</span>'th previous<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;occurrence of&nbsp;<span class="Special">{pattern}</span>&nbsp;and go&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>&nbsp;lines up or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;down&nbsp;<a class="Identifier" href="motion.html#linewise">linewise</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#?<CR>" name="?&lt;CR&gt;">?&lt;CR&gt;</a><br>
?<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Search backward for the&nbsp;<span class="Special">[count]</span>'th occurrence of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latest used pattern&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;with latest used<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>.<br>
<br>
??<span class="Special">{offset}&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Search backward for the&nbsp;<span class="Special">[count]</span>'th occurrence of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latest used pattern&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;with new<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#{offset}">{offset}</a>.&nbsp;&nbsp;If&nbsp;<span class="Special">{offset}</span>&nbsp;is empty no offset is used.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#n" name="n">n</a><br>
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeat the latest &quot;/&quot; or &quot;?&quot;&nbsp;<span class="Special">[count]</span>&nbsp;times.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If the cursor doesn't move the search is repeated with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count + 1.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;<span class="Special">{Vi: no count}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#N" name="N">N</a><br>
<span class="Special">N</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeat the latest &quot;/&quot; or &quot;?&quot;&nbsp;<span class="Special">[count]</span>&nbsp;times in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opposite direction.&nbsp;<a class="Identifier" href="pattern.html#last-pattern">last-pattern</a>&nbsp;<span class="Special">{Vi: no count}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#star" name="star">star</a>&nbsp;<a class="Constant" href="pattern.html#E348" name="E348">E348</a>&nbsp;<a class="Constant" href="pattern.html#E349" name="E349">E349</a><br>
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Search forward for the&nbsp;<span class="Special">[count]</span>'th occurrence of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word nearest to the cursor.&nbsp;&nbsp;The word used for the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;search is the first of:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. the keyword under the cursor&nbsp;<a class="Identifier" href="options.html#'iskeyword'">'iskeyword'</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. the first keyword after the cursor, in the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; current line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. the non-blank word under the cursor<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. the first non-blank word after the cursor,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the current line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Only whole keywords are searched for, like with the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command &quot;/\&lt;keyword\&gt;&quot;.&nbsp;&nbsp;<a class="Identifier" href="motion.html#exclusive">exclusive</a>&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;is used,&nbsp;<a class="Type" href="options.html#'smartcase'">'smartcase'</a>&nbsp;is not.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html##" name="#">#</a><br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Same as &quot;*&quot;, but search backward.&nbsp;&nbsp;The pound sign<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(character 163) also works.&nbsp;&nbsp;If the &quot;#&quot; key works as<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;backspace, try using &quot;stty erase&nbsp;<span class="Special">&lt;BS&gt;</span>&quot; before starting<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vim (<span class="Special">&lt;BS&gt;</span>&nbsp;is&nbsp;<span class="Special">CTRL-H</span>&nbsp;or a real backspace).&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#gstar" name="gstar">gstar</a><br>
g*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;*&quot;, but don't put &quot;\&lt;&quot; and &quot;\&gt;&quot; around the word.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This makes the search also find matches that are not a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whole word.&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#g#" name="g#">g#</a><br>
g#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;#&quot;, but don't put &quot;\&lt;&quot; and &quot;\&gt;&quot; around the word.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This makes the search also find matches that are not a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whole word.&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#gd" name="gd">gd</a><br>
gd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Goto local Declaration.&nbsp;&nbsp;When the cursor is on a local<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variable, this command will jump to its declaration.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First Vim searches for the start of the current<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function, just like &quot;[[&quot;.&nbsp;&nbsp;If it is not found the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;search stops in line 1.&nbsp;&nbsp;If it is found, Vim goes back<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until a blank line is found.&nbsp;&nbsp;From this position Vim<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searches for the keyword under the cursor, like with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;*&quot;, but lines that look like a comment are ignored<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(see&nbsp;<a class="Type" href="options.html#'comments'">'comments'</a>&nbsp;option).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that this is not guaranteed to work, Vim does not<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;really check the syntax, it only searches for a match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with the keyword.&nbsp;&nbsp;If included files also need to be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searched use the commands listed in&nbsp;<a class="Identifier" href="tagsrch.html#include-search">include-search</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After this command&nbsp;<a class="Identifier" href="pattern.html#n">n</a>&nbsp;searches forward for the next<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match (not backward).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#gD" name="gD">gD</a><br>
gD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Goto global Declaration.&nbsp;&nbsp;When the cursor is on a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;global variable that is defined in the file, this<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command will jump to its declaration.&nbsp;&nbsp;This works just<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;gd&quot;, except that the search for the keyword<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;always starts in line 1.&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#1gd" name="1gd">1gd</a><br>
1gd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Like &quot;gd&quot;, but ignore matches inside a {} block that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ends before the cursor position.&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#1gD" name="1gD">1gD</a><br>
1gD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Like &quot;gD&quot;, but ignore matches inside a {} block that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ends before the cursor position.&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#CTRL-C" name="CTRL-C">CTRL-C</a><br>
<span class="Special">CTRL-C</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupt current (search) command.&nbsp;&nbsp;Use&nbsp;<span class="Special">CTRL-Break</span>&nbsp;on<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MS-DOS&nbsp;<a class="Identifier" href="os_dos.html#dos-CTRL-Break">dos-CTRL-Break</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In Normal mode, any pending command is aborted.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#:noh" name=":noh">:noh</a>&nbsp;<a class="Constant" href="pattern.html#:nohlsearch" name=":nohlsearch">:nohlsearch</a><br>
:noh[lsearch]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stop the highlighting for the&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;option.&nbsp;&nbsp;It<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is automatically turned back on when using a search<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command, or setting the&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;option.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This command doesn't work in an autocommand, because<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the highlighting state is saved and restored when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;executing autocommands&nbsp;<a class="Identifier" href="autocmd.html#autocmd-searchpat">autocmd-searchpat</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Same thing for when invoking a user function.<br>
<br>
While typing the search pattern the current match will be shown if the<br>
<a class="Type" href="options.html#'incsearch'">'incsearch'</a>&nbsp;option is on.&nbsp;&nbsp;Remember that you still have to finish the search<br>
command with&nbsp;<span class="Special">&lt;CR&gt;</span>&nbsp;to actually position the cursor at the displayed match.&nbsp;&nbsp;Or<br>
use&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;to abandon the search.<br>
<br>
All matches for the last used search pattern will be highlighted if you set<br>
the&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;option.&nbsp;&nbsp;This can be suspended with the&nbsp;<a class="Identifier" href="pattern.html#:nohlsearch">:nohlsearch</a>&nbsp;command.<br>
<br>
When no match is found you get the error:&nbsp;<a class="Constant" href="pattern.html#E486" name="E486">E486</a>&nbsp;Pattern not found<br>
<span class="Todo">Note</span>&nbsp;that for the&nbsp;<a class="Identifier" href="repeat.html#:global">:global</a>&nbsp;command this behaves like a normal message, for Vi<br>
compatibility.&nbsp;&nbsp;For the&nbsp;<a class="Identifier" href="change.html#:s">:s</a>&nbsp;command the &quot;e&quot; flag can be used to avoid the<br>
error message&nbsp;<a class="Identifier" href="change.html#:s_flags">:s_flags</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#search-offset" name="search-offset">search-offset</a>&nbsp;<a class="Constant" href="pattern.html#{offset}" name="{offset}">{offset}</a><br>
These commands search for the specified pattern.&nbsp;&nbsp;With &quot;/&quot; and &quot;?&quot; an<br>
additional offset may be given.&nbsp;&nbsp;There are two types of offsets: line offsets<br>
and character offsets.&nbsp;&nbsp;{the character offsets are not in Vi}<br>
<br>
The offset gives the cursor position relative to the found match:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;lines downwards, in column 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;+<span class="Special">[num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;lines downwards, in column 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;-<span class="Special">[num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;lines upwards, in column 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;e<span class="Special">[+num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;characters to the right of the end of the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;e<span class="Special">[-num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;characters to the left of the end of the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;s<span class="Special">[+num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;characters to the right of the start of the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;s<span class="Special">[-num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;characters to the left of the start of the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;b<span class="Special">[+num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;identical to s<span class="Special">[+num]</span>&nbsp;above (mnemonic: begin)<br>
&nbsp;&nbsp;&nbsp;&nbsp;b<span class="Special">[-num]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[num]</span>&nbsp;identical to s<span class="Special">[-num]</span>&nbsp;above (mnemonic: begin)<br>
&nbsp;&nbsp;&nbsp;&nbsp;;<span class="Special">{pattern}</span>&nbsp;&nbsp;perform another search, see&nbsp;<a class="Identifier" href="pattern.html#//;">//;</a><br>
<br>
If a '-' or '+' is given but&nbsp;<span class="Special">[num]</span>&nbsp;is omitted, a count of one will be used.<br>
When including an offset with 'e', the search becomes inclusive (the<br>
character the cursor lands on is included in operations).<br>
<br>
Examples:<br>
<br>
<span class="PreProc">pattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cursor position</span><br>
/test/+1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;one line below &quot;test&quot;, in column 1<br>
/test/e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on the last t of &quot;test&quot;<br>
/test/s+2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on the 's' of &quot;test&quot;<br>
/test/b-3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; three characters before &quot;test&quot;<br>
<br>
If one of these commands is used after an operator, the characters between<br>
the cursor position before and after the search is affected.&nbsp;&nbsp;However, if a<br>
line offset is given, the whole lines between the two cursor positions are<br>
affected.<br>
<br>
An example of how to search for matches with a pattern and change the match<br>
with another word:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/foo&lt;CR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;find &quot;foo&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c//e&lt;CR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;change until end of match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bar&lt;Esc&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type replacement<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&lt;CR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go to start of next match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c//e&lt;CR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;change until end of match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beep&lt;Esc&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type another replacement<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;etc.</div>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#//;" name="//;">//;</a>&nbsp;<a class="Constant" href="pattern.html#E386" name="E386">E386</a><br>
A very special offset is ';' followed by another search command.&nbsp;&nbsp;For example:<br>
<br>
<div class="helpExample">&nbsp;&nbsp; /test 1/;/test<br>
&nbsp;&nbsp; /test.*/+1;?ing?</div>
<br>
The first one first finds the next occurrence of &quot;test 1&quot;, and then the first<br>
occurrence of &quot;test&quot; after that.<br>
<br>
This is like executing two search commands after each other, except that:<br>
- It can be used as a single motion command after an operator.<br>
- The direction for a following &quot;n&quot; or &quot;<span class="Special">N</span>&quot; command comes from the first<br>
&nbsp;&nbsp;search command.<br>
- When an error occurs the cursor is not moved at all.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#last-pattern" name="last-pattern">last-pattern</a><br>
The last used pattern and offset are remembered.&nbsp;&nbsp;They can be used to repeat<br>
the search, possibly in another direction or with another count.&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that<br>
two patterns are remembered: One for&nbsp;<span class="MissingTag">'normal'</span>&nbsp;search commands and one for the<br>
substitute command &quot;:s&quot;.&nbsp;&nbsp;Each time an empty pattern is given, the previously<br>
used pattern is used.&nbsp;&nbsp;However, if there is no previous search command, a<br>
previous substitute pattern is used, if possible.<br>
<br>
The&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;option sticks with the last used pattern.&nbsp;&nbsp;If you change&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>,<br>
this will not change how the last used pattern will be interpreted.<br>
The&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;option does not do this.&nbsp;&nbsp;When&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;is changed, it<br>
will result in the pattern to match other text.<br>
<br>
All matches for the last used search pattern will be highlighted if you set<br>
the&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;option.<br>
<br>
To clear the last used search pattern:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:let @/ = &quot;&quot;</div>
This will not set the pattern to an empty string, because that would match<br>
everywhere.&nbsp;&nbsp;The pattern is really cleared, like when starting Vim.<br>
<br>
The search usually skips matches that don't move the cursor.&nbsp;&nbsp;Whether the next<br>
match is found at the next character or after the skipped match depends on the<br>
'c' flag in&nbsp;<a class="Type" href="options.html#'cpoptions'">'cpoptions'</a>.&nbsp;&nbsp;See&nbsp;<a class="Identifier" href="options.html#cpo-c">cpo-c</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with 'c' flag:&nbsp;&nbsp; &quot;/...&quot; advances 1 to 3 characters<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;without 'c' flag:&nbsp;&nbsp; &quot;/...&quot; advances 1 character<br>
The unpredictability with the 'c' flag is caused by starting the search in the<br>
first column, skipping matches until one is found past the cursor position.<br>
<br>
When searching backwards, searching starts at the start of the line, using the<br>
'c' flag in&nbsp;<a class="Type" href="options.html#'cpoptions'">'cpoptions'</a>&nbsp;as described above.&nbsp;&nbsp;Then the last match before the<br>
cursor position is used.<br>
<br>
In Vi the &quot;:tag&quot; command sets the last search pattern when the tag is searched<br>
for.&nbsp;&nbsp;In Vim this is not done, the previous search pattern is still remembered,<br>
unless the 't' flag is present in&nbsp;<a class="Type" href="options.html#'cpoptions'">'cpoptions'</a>.&nbsp;&nbsp;The search pattern is always<br>
put in the search history.<br>
<br>
If the&nbsp;<a class="Type" href="options.html#'wrapscan'">'wrapscan'</a>&nbsp;option is on (which is the default), searches wrap around<br>
the end of the buffer.&nbsp;&nbsp;If&nbsp;<a class="Type" href="options.html#'wrapscan'">'wrapscan'</a>&nbsp;is not set, the backward search stops<br>
at the beginning and the forward search stops at the end of the buffer.&nbsp;&nbsp;If<br>
<a class="Type" href="options.html#'wrapscan'">'wrapscan'</a>&nbsp;is set and the pattern was not found the error message &quot;pattern<br>
not found&quot; is given, and the cursor will not be moved.&nbsp;&nbsp;If&nbsp;<a class="Type" href="options.html#'wrapscan'">'wrapscan'</a>&nbsp;is not<br>
set the message becomes &quot;search hit BOTTOM without match&quot; when searching<br>
forward, or &quot;search hit TOP without match&quot; when searching backward.&nbsp;&nbsp;If<br>
wrapscan is set and the search wraps around the end of the file the message<br>
&quot;search hit TOP, continuing at BOTTOM&quot; or &quot;search hit BOTTOM, continuing at<br>
TOP&quot; is given when searching backwards or forwards respectively.&nbsp;&nbsp;This can be<br>
switched off by setting the 's' flag in the&nbsp;<a class="Type" href="options.html#'shortmess'">'shortmess'</a>&nbsp;option.&nbsp;&nbsp;The highlight<br>
method 'w' is used for this message (default: standout).<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#search-range" name="search-range">search-range</a><br>
You can limit the search command &quot;/&quot; to a certain range of lines by including<br>
\%&gt;l items.&nbsp;&nbsp;For example, to match the word &quot;limit&quot; below line 199 and above<br>
line 300:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%&gt;199l\%&lt;300llimit</div>
Also see&nbsp;<a class="Identifier" href="pattern.html#/\%>l">/\%&gt;l</a>.<br>
<br>
Another way is to use the &quot;:substitute&quot; command with the 'c' flag.&nbsp;&nbsp;Example:<br>
<div class="helpExample">&nbsp;&nbsp; :.,300s/Pattern//gc</div>
This command will search from the cursor position until line 300 for<br>
&quot;Pattern&quot;.&nbsp;&nbsp;At the match, you will be asked to type a character.&nbsp;&nbsp;Type 'q' to<br>
stop at this match, type 'n' to find the next match.<br>
<br>
The &quot;*&quot;, &quot;#&quot;, &quot;g*&quot; and &quot;g#&quot; commands look for a word near the cursor in this<br>
order, the first one that is found is used:<br>
- The keyword currently under the cursor.<br>
- The first keyword to the right of the cursor, in the same line.<br>
- The WORD currently under the cursor.<br>
- The first WORD to the right of the cursor, in the same line.<br>
The keyword may only contain letters and characters in&nbsp;<a class="Type" href="options.html#'iskeyword'">'iskeyword'</a>.<br>
The WORD may contain any non-blanks (<span class="Special">&lt;Tab&gt;</span>s and/or&nbsp;<span class="Special">&lt;Space&gt;</span>s).<br>
<span class="Todo">Note</span>&nbsp;that if you type with ten fingers, the characters are easy to remember:<br>
the &quot;#&quot; is under your left hand middle finger (search to the left and up) and<br>
the &quot;*&quot; is under your right hand middle finger (search to the right and down).<br>
(this depends on your keyboard layout though).<br>
<br>
<span class="PreProc">==============================================================================</span><br>
2. The definition of a pattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#search-pattern" name="search-pattern">search-pattern</a>&nbsp;<a class="Constant" href="pattern.html#pattern" name="pattern">pattern</a>&nbsp;<a class="Constant" href="pattern.html#[pattern]" name="[pattern]">[pattern]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#regular-expression" name="regular-expression">regular-expression</a>&nbsp;<a class="Constant" href="pattern.html#regexp" name="regexp">regexp</a>&nbsp;<a class="Constant" href="pattern.html#Pattern" name="Pattern">Pattern</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E76" name="E76">E76</a>&nbsp;<a class="Constant" href="pattern.html#E383" name="E383">E383</a>&nbsp;<a class="Constant" href="pattern.html#E476" name="E476">E476</a><br>
<br>
For starters, read chapter 27 of the user manual&nbsp;<a class="Identifier" href="usr_27.html">usr_27.txt</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/bar" name="/bar">/bar</a>&nbsp;<a class="Constant" href="pattern.html#/\bar" name="/\bar">/\bar</a>&nbsp;<a class="Constant" href="pattern.html#/pattern" name="/pattern">/pattern</a><br>
1. A pattern is one or more branches, separated by &quot;\|&quot;.&nbsp;&nbsp;It matches anything<br>
&nbsp;&nbsp; that matches one of the branches.&nbsp;&nbsp;Example: &quot;foo\|beep&quot; matches &quot;foo&quot; and<br>
&nbsp;&nbsp; matches &quot;beep&quot;.&nbsp;&nbsp;If more than one branch matches, the first one is used.<br>
<br>
&nbsp;&nbsp; pattern ::=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;branch<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;branch \| branch<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;branch \| branch \| branch<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;etc.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/branch" name="/branch">/branch</a>&nbsp;<a class="Constant" href="pattern.html#/\&" name="/\&amp;">/\&amp;</a><br>
2. A branch is one or more concats, separated by &quot;\&amp;&quot;.&nbsp;&nbsp;It matches the last<br>
&nbsp;&nbsp; concat, but only if all the preceding concats also match at the same<br>
&nbsp;&nbsp; position.&nbsp;&nbsp;Examples:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;foobeep\&amp;...&quot; matches &quot;foo&quot; in &quot;foobeep&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;.*Peter\&amp;.*Bob&quot; matches in a line containing both &quot;Peter&quot; and &quot;Bob&quot;<br>
<br>
&nbsp;&nbsp; branch ::=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; concat<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;concat \&amp; concat<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;concat \&amp; concat \&amp; concat<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;etc.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/concat" name="/concat">/concat</a><br>
3. A concat is one or more pieces, concatenated.&nbsp;&nbsp;It matches a match for the<br>
&nbsp;&nbsp; first piece, followed by a match for the second piece, etc.&nbsp;&nbsp;Example:<br>
&nbsp;&nbsp; &quot;f[0-9]b&quot;, first matches &quot;f&quot;, then a digit and then &quot;b&quot;.<br>
<br>
&nbsp;&nbsp; concat&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;piece<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;piece piece<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;piece piece piece<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;etc.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/piece" name="/piece">/piece</a><br>
4. A piece is an atom, possibly followed by a multi, an indication of how many<br>
&nbsp;&nbsp; times the atom can be matched.&nbsp;&nbsp;Example: &quot;a*&quot; matches any sequence of &quot;a&quot;<br>
&nbsp;&nbsp; characters: &quot;&quot;, &quot;a&quot;, &quot;aa&quot;, etc.&nbsp;&nbsp;See&nbsp;<a class="Identifier" href="pattern.html#/multi">/multi</a>.<br>
<br>
&nbsp;&nbsp; piece&nbsp;&nbsp; ::=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;atom<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;atom&nbsp;&nbsp;multi<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/atom" name="/atom">/atom</a><br>
5. An atom can be one of a long list of items.&nbsp;&nbsp;Many atoms match one character<br>
&nbsp;&nbsp; in the text.&nbsp;&nbsp;It is often an ordinary character or a character class.<br>
&nbsp;&nbsp; Braces can be used to make a pattern into an atom.&nbsp;&nbsp;The &quot;\z(\)&quot; construct<br>
&nbsp;&nbsp; is only for syntax highlighting.<br>
<br>
&nbsp;&nbsp; atom&nbsp;&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ordinary-atom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/ordinary-atom">/ordinary-atom</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;\( pattern \)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/\(">/\(</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;\%( pattern \)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/\%(">/\%(</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;\z( pattern \)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="syntax.html#/\z(">/\z(</a><br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%#=" name="/\%#=">/\%#=</a>&nbsp;<a class="Constant" href="pattern.html#two-engines" name="two-engines">two-engines</a>&nbsp;<a class="Constant" href="pattern.html#NFA" name="NFA">NFA</a><br>
Vim includes two regexp engines:<br>
1. An old, backtracking engine that supports everything.<br>
2. A new, NFA engine that works much faster on some patterns, possibly slower<br>
&nbsp;&nbsp; on some patterns.<br>
<br>
Vim will automatically select the right engine for you.&nbsp;&nbsp;However, if you run<br>
into a problem or want to specifically select one engine or the other, you can<br>
prepend one of the following to the pattern:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\%#=0&nbsp;&nbsp; Force automatic selection.&nbsp;&nbsp;Only has an effect when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'regexpengine'">'regexpengine'</a>&nbsp;has been set to a non-zero value.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\%#=1&nbsp;&nbsp; Force using the old engine.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\%#=2&nbsp;&nbsp; Force using the NFA engine.<br>
<br>
You can also use the&nbsp;<a class="Type" href="options.html#'regexpengine'">'regexpengine'</a>&nbsp;option to change the default.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E864" name="E864">E864</a>&nbsp;<a class="Constant" href="pattern.html#E868" name="E868">E868</a>&nbsp;<a class="Constant" href="pattern.html#E874" name="E874">E874</a>&nbsp;<a class="Constant" href="pattern.html#E875" name="E875">E875</a>&nbsp;<a class="Constant" href="pattern.html#E876" name="E876">E876</a>&nbsp;<a class="Constant" href="pattern.html#E877" name="E877">E877</a>&nbsp;<a class="Constant" href="pattern.html#E878" name="E878">E878</a><br>
If selecting the NFA engine and it runs into something that is not implemented<br>
the pattern will not match.&nbsp;&nbsp;This is only useful when debugging Vim.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
3. Magic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/magic" name="/magic">/magic</a><br>
<br>
Some characters in the pattern are taken literally.&nbsp;&nbsp;They match with the same<br>
character in the text.&nbsp;&nbsp;When preceded with a backslash however, these<br>
characters get a special meaning.<br>
<br>
Other characters have a special meaning without a backslash.&nbsp;&nbsp;They need to be<br>
preceded with a backslash to match literally.<br>
<br>
If a character is taken literally or not depends on the&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;option and the<br>
items mentioned next.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\m" name="/\m">/\m</a>&nbsp;<a class="Constant" href="pattern.html#/\M" name="/\M">/\M</a><br>
Use of &quot;\m&quot; makes the pattern after it be interpreted as if&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;is set,<br>
ignoring the actual value of the&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;option.<br>
Use of &quot;\M&quot; makes the pattern after it be interpreted as if&nbsp;<a class="Type" href="options.html#'nomagic'">'nomagic'</a>&nbsp;is used.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\v" name="/\v">/\v</a>&nbsp;<a class="Constant" href="pattern.html#/\V" name="/\V">/\V</a><br>
Use of &quot;\v&quot; means that in the pattern after it all ASCII characters except<br>
'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning.&nbsp;&nbsp;&quot;very magic&quot;<br>
<br>
Use of &quot;\V&quot; means that in the pattern after it only the backslash and the<br>
terminating character (/ or ?) has a special meaning.&nbsp;&nbsp;&quot;very nomagic&quot;<br>
<br>
Examples:<br>
<span class="PreProc">after:&nbsp;&nbsp;&nbsp;&nbsp;\v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;<a class="Type" href="options.html#'nomagic'">'nomagic'</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches end-of-line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches any character<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any number of the previous atom<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; latest substitute string<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \(\)&nbsp;&nbsp;&nbsp;&nbsp; \(\)&nbsp;&nbsp;&nbsp;&nbsp; \(\)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; grouping into an atom<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; separating alternatives<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alphabetic character<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; literal backslash<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;literal dot<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;literal '{'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;literal 'a'<br>
<br>
<span class="Special">{only Vim supports \m, \M, \v and \V}</span><br>
<br>
It is recommended to always keep the&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;option at the default setting,<br>
which is&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>.&nbsp;&nbsp;This avoids portability problems.&nbsp;&nbsp;To make a pattern immune<br>
to the&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;option being set or not, put &quot;\m&quot; or &quot;\M&quot; at the start of the<br>
pattern.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
4. Overview of pattern items&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#pattern-overview" name="pattern-overview">pattern-overview</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E865" name="E865">E865</a>&nbsp;<a class="Constant" href="pattern.html#E866" name="E866">E866</a>&nbsp;<a class="Constant" href="pattern.html#E867" name="E867">E867</a>&nbsp;<a class="Constant" href="pattern.html#E869" name="E869">E869</a><br>
<br>
Overview of multi items.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/multi" name="/multi">/multi</a>&nbsp;<a class="Constant" href="pattern.html#E61" name="E61">E61</a>&nbsp;<a class="Constant" href="pattern.html#E62" name="E62">E62</a><br>
More explanation and examples below, follow the links.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E64" name="E64">E64</a>&nbsp;<a class="Constant" href="pattern.html#E871" name="E871">E871</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">multi</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">'magic' 'nomagic'&nbsp;&nbsp;matches of the preceding atom</span><br>
<a class="Identifier" href="pattern.html#/star">/star</a>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 or more&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as many as possible<br>
<a class="Identifier" href="pattern.html#/\+">/\+</a>&nbsp;&nbsp; \+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 or more&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as many as possible (*)<br>
<a class="Identifier" href="pattern.html#/\=">/\=</a>&nbsp;&nbsp; \=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 or 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as many as possible (*)<br>
<a class="Identifier" href="pattern.html#/\?">/\?</a>&nbsp;&nbsp; \?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 or 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as many as possible (*)<br>
<br>
<a class="Identifier" href="pattern.html#/\{">/\{</a>&nbsp;&nbsp; \<span class="Special">{n,m}</span>&nbsp;&nbsp;\<span class="Special">{n,m}</span>&nbsp;&nbsp;n to m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as many as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{n}</span>&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{n}</span>&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exactly (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{n,}</span>&nbsp;&nbsp; \<span class="Special">{n,}</span>&nbsp;&nbsp; at least n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as many as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{,m}</span>&nbsp;&nbsp; \<span class="Special">{,m}</span>&nbsp;&nbsp; 0 to m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as many as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{}&nbsp;&nbsp;&nbsp;&nbsp; \{}&nbsp;&nbsp;&nbsp;&nbsp; 0 or more&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as many as possible (same as *) (*)<br>
<br>
<a class="Identifier" href="pattern.html#/\{-">/\{-</a>&nbsp;&nbsp;\<span class="Special">{-n,m}</span>&nbsp;\<span class="Special">{-n,m}</span>&nbsp;n to m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as few as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-n}</span>&nbsp;&nbsp; \<span class="Special">{-n}</span>&nbsp;&nbsp; n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exactly (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-n,}</span>&nbsp;&nbsp;\<span class="Special">{-n,}</span>&nbsp;&nbsp;at least n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as few as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-,m}</span>&nbsp;&nbsp;\<span class="Special">{-,m}</span>&nbsp;&nbsp;0 to m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as few as possible (*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-}</span>&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-}</span>&nbsp;&nbsp;&nbsp;&nbsp;0 or more&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as few as possible (*)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E59" name="E59">E59</a><br>
<a class="Identifier" href="pattern.html#/\@>">/\@&gt;</a>&nbsp;&nbsp;\@&gt;&nbsp;&nbsp;&nbsp;&nbsp; \@&gt;&nbsp;&nbsp;&nbsp;&nbsp; 1, like matching a whole pattern (*)<br>
<a class="Identifier" href="pattern.html#/\@=">/\@=</a>&nbsp;&nbsp;\@=&nbsp;&nbsp;&nbsp;&nbsp; \@=&nbsp;&nbsp;&nbsp;&nbsp; nothing, requires a match&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;(*)<br>
<a class="Identifier" href="pattern.html#/\@!">/\@!</a>&nbsp;&nbsp;\@!&nbsp;&nbsp;&nbsp;&nbsp; \@!&nbsp;&nbsp;&nbsp;&nbsp; nothing, requires NO match&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;(*)<br>
<a class="Identifier" href="pattern.html#/\@<=">/\@&lt;=</a>&nbsp;\@&lt;=&nbsp;&nbsp;&nbsp;&nbsp;\@&lt;=&nbsp;&nbsp;&nbsp;&nbsp;nothing, requires a match behind&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;(*)<br>
<a class="Identifier" href="pattern.html#/\@<!">/\@&lt;!</a>&nbsp;\@&lt;!&nbsp;&nbsp;&nbsp;&nbsp;\@&lt;!&nbsp;&nbsp;&nbsp;&nbsp;nothing, requires NO match behind&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;(*)<br>
<br>
(*)&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
<br>
Overview of ordinary atoms.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/ordinary-atom" name="/ordinary-atom">/ordinary-atom</a><br>
More explanation and examples below, follow the links.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">ordinary atom</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">magic&nbsp;&nbsp; nomagic&nbsp;&nbsp; matches</span><br>
<a class="Identifier" href="pattern.html#/^">/^</a>&nbsp;&nbsp;&nbsp;&nbsp;^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start-of-line (at start of pattern)&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\^">/\^</a>&nbsp;&nbsp; \^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;literal '^'<br>
<a class="Identifier" href="pattern.html#/\_^">/\_^</a>&nbsp;&nbsp;\_^&nbsp;&nbsp;&nbsp;&nbsp; \_^&nbsp;&nbsp;&nbsp;&nbsp; start-of-line (used anywhere)&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/$">/$</a>&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end-of-line (at end of pattern)&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\$">/\$</a>&nbsp;&nbsp; \$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;literal '$'<br>
<a class="Identifier" href="pattern.html#/\_$">/\_$</a>&nbsp;&nbsp;\_$&nbsp;&nbsp;&nbsp;&nbsp; \_$&nbsp;&nbsp;&nbsp;&nbsp; end-of-line (used anywhere)&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/.">/.</a>&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any single character (not an end-of-line)<br>
<a class="Identifier" href="pattern.html#/\_.">/\_.</a>&nbsp;&nbsp;\_.&nbsp;&nbsp;&nbsp;&nbsp; \_.&nbsp;&nbsp;&nbsp;&nbsp; any single character or end-of-line<br>
<a class="Identifier" href="pattern.html#/\<">/\&lt;</a>&nbsp;&nbsp; \&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beginning of a word&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\>">/\&gt;</a>&nbsp;&nbsp; \&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end of a word&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\zs">/\zs</a>&nbsp;&nbsp;\zs&nbsp;&nbsp;&nbsp;&nbsp; \zs&nbsp;&nbsp;&nbsp;&nbsp; anything, sets start of match<br>
<a class="Identifier" href="pattern.html#/\ze">/\ze</a>&nbsp;&nbsp;\ze&nbsp;&nbsp;&nbsp;&nbsp; \ze&nbsp;&nbsp;&nbsp;&nbsp; anything, sets end of match<br>
<a class="Identifier" href="pattern.html#/\%^">/\%^</a>&nbsp;&nbsp;\%^&nbsp;&nbsp;&nbsp;&nbsp; \%^&nbsp;&nbsp;&nbsp;&nbsp; beginning of file&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E71" name="E71">E71</a><br>
<a class="Identifier" href="pattern.html#/\%$">/\%$</a>&nbsp;&nbsp;\%$&nbsp;&nbsp;&nbsp;&nbsp; \%$&nbsp;&nbsp;&nbsp;&nbsp; end of file&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%V">/\%V</a>&nbsp;&nbsp;\%V&nbsp;&nbsp;&nbsp;&nbsp; \%V&nbsp;&nbsp;&nbsp;&nbsp; inside Visual area&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%#">/\%#</a>&nbsp;&nbsp;\%#&nbsp;&nbsp;&nbsp;&nbsp; \%#&nbsp;&nbsp;&nbsp;&nbsp; cursor position&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%'m">/\%'m</a>&nbsp;\%'m&nbsp;&nbsp;&nbsp;&nbsp;\%'m&nbsp;&nbsp;&nbsp;&nbsp;mark m position&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%l">/\%l</a>&nbsp;&nbsp;\%23l&nbsp;&nbsp; \%23l&nbsp;&nbsp; in line 23&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%c">/\%c</a>&nbsp;&nbsp;\%23c&nbsp;&nbsp; \%23c&nbsp;&nbsp; in column 23&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<a class="Identifier" href="pattern.html#/\%v">/\%v</a>&nbsp;&nbsp;\%23v&nbsp;&nbsp; \%23v&nbsp;&nbsp; in virtual column 23&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<br>
Character classes&nbsp;<span class="Special">{not in Vi}</span>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/character-classes" name="/character-classes">/character-classes</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">magic&nbsp;&nbsp; nomagic&nbsp;&nbsp; matches</span><br>
<a class="Identifier" href="pattern.html#/\i">/\i</a>&nbsp;&nbsp; \i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;identifier character (see&nbsp;<a class="Type" href="options.html#'isident'">'isident'</a>&nbsp;option)<br>
<a class="Identifier" href="pattern.html#/\I">/\I</a>&nbsp;&nbsp; \I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\i&quot;, but excluding digits<br>
<a class="Identifier" href="pattern.html#/\k">/\k</a>&nbsp;&nbsp; \k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keyword character (see&nbsp;<a class="Type" href="options.html#'iskeyword'">'iskeyword'</a>&nbsp;option)<br>
<a class="Identifier" href="pattern.html#/\K">/\K</a>&nbsp;&nbsp; \K&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\K&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\k&quot;, but excluding digits<br>
<a class="Identifier" href="pattern.html#/\f">/\f</a>&nbsp;&nbsp; \f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file name character (see&nbsp;<a class="Type" href="options.html#'isfname'">'isfname'</a>&nbsp;option)<br>
<a class="Identifier" href="pattern.html#/\F">/\F</a>&nbsp;&nbsp; \F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\f&quot;, but excluding digits<br>
<a class="Identifier" href="pattern.html#/\p">/\p</a>&nbsp;&nbsp; \p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printable character (see&nbsp;<a class="Type" href="options.html#'isprint'">'isprint'</a>&nbsp;option)<br>
<a class="Identifier" href="pattern.html#/\P">/\P</a>&nbsp;&nbsp; \P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\p&quot;, but excluding digits<br>
<a class="Identifier" href="pattern.html#/\s">/\s</a>&nbsp;&nbsp; \s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whitespace character:&nbsp;<span class="Special">&lt;Space&gt;</span>&nbsp;and&nbsp;<span class="Special">&lt;Tab&gt;</span><br>
<a class="Identifier" href="pattern.html#/\S">/\S</a>&nbsp;&nbsp; \S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-whitespace character; opposite of \s<br>
<a class="Identifier" href="pattern.html#/\d">/\d</a>&nbsp;&nbsp; \d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9]</span><br>
<a class="Identifier" href="pattern.html#/\D">/\D</a>&nbsp;&nbsp; \D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9]</span><br>
<a class="Identifier" href="pattern.html#/\x">/\x</a>&nbsp;&nbsp; \x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hex digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9A-Fa-f]</span><br>
<a class="Identifier" href="pattern.html#/\X">/\X</a>&nbsp;&nbsp; \X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-hex digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9A-Fa-f]</span><br>
<a class="Identifier" href="pattern.html#/\o">/\o</a>&nbsp;&nbsp; \o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;octal digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-7]</span><br>
<a class="Identifier" href="pattern.html#/\O">/\O</a>&nbsp;&nbsp; \O&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\O&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-octal digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-7]</span><br>
<a class="Identifier" href="pattern.html#/\w">/\w</a>&nbsp;&nbsp; \w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9A-Za-z_]</span><br>
<a class="Identifier" href="pattern.html#/\W">/\W</a>&nbsp;&nbsp; \W&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\W&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9A-Za-z_]</span><br>
<a class="Identifier" href="pattern.html#/\h">/\h</a>&nbsp;&nbsp; \h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head of word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Za-z_]</span><br>
<a class="Identifier" href="pattern.html#/\H">/\H</a>&nbsp;&nbsp; \H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-head of word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Za-z_]</span><br>
<a class="Identifier" href="pattern.html#/\a">/\a</a>&nbsp;&nbsp; \a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alphabetic character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Za-z]</span><br>
<a class="Identifier" href="pattern.html#/\A">/\A</a>&nbsp;&nbsp; \A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-alphabetic character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Za-z]</span><br>
<a class="Identifier" href="pattern.html#/\l">/\l</a>&nbsp;&nbsp; \l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lowercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[a-z]</span><br>
<a class="Identifier" href="pattern.html#/\L">/\L</a>&nbsp;&nbsp; \L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-lowercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^a-z]</span><br>
<a class="Identifier" href="pattern.html#/\u">/\u</a>&nbsp;&nbsp; \u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uppercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Z]</span><br>
<a class="Identifier" href="pattern.html#/\U">/\U</a>&nbsp;&nbsp; \U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-uppercase character&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Z]</span><br>
<a class="Identifier" href="pattern.html#/\_">/\_</a>&nbsp;&nbsp; \_x&nbsp;&nbsp;&nbsp;&nbsp; \_x&nbsp;&nbsp;&nbsp;&nbsp; where x is any of the characters above: character<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class with end-of-line included<br>
(end of character classes)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">magic&nbsp;&nbsp; nomagic&nbsp;&nbsp; matches</span><br>
<a class="Identifier" href="pattern.html#/\e">/\e</a>&nbsp;&nbsp; \e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Esc&gt;</span><br>
<a class="Identifier" href="pattern.html#/\t">/\t</a>&nbsp;&nbsp; \t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Tab&gt;</span><br>
<a class="Identifier" href="pattern.html#/\r">/\r</a>&nbsp;&nbsp; \r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;CR&gt;</span><br>
<a class="Identifier" href="pattern.html#/\b">/\b</a>&nbsp;&nbsp; \b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;BS&gt;</span><br>
<a class="Identifier" href="pattern.html#/\n">/\n</a>&nbsp;&nbsp; \n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end-of-line<br>
<a class="Identifier" href="pattern.html#/~">/~</a>&nbsp;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last given substitute string<br>
<a class="Identifier" href="pattern.html#/\1">/\1</a>&nbsp;&nbsp; \1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same string as matched by first \(\)&nbsp;<span class="Special">{not in Vi}</span><br>
<a class="Identifier" href="pattern.html#/\2">/\2</a>&nbsp;&nbsp; \2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\1&quot;, but uses second \(\)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
<a class="Identifier" href="pattern.html#/\9">/\9</a>&nbsp;&nbsp; \9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\1&quot;, but uses ninth \(\)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E68" name="E68">E68</a><br>
<a class="Identifier" href="syntax.html#/\z1">/\z1</a>&nbsp;&nbsp;\z1&nbsp;&nbsp;&nbsp;&nbsp; \z1&nbsp;&nbsp;&nbsp;&nbsp; only for syntax highlighting, see&nbsp;<a class="Identifier" href="syntax.html#:syn-ext-match">:syn-ext-match</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
<a class="Identifier" href="syntax.html#/\z1">/\z1</a>&nbsp;&nbsp;\z9&nbsp;&nbsp;&nbsp;&nbsp; \z9&nbsp;&nbsp;&nbsp;&nbsp; only for syntax highlighting, see&nbsp;<a class="Identifier" href="syntax.html#:syn-ext-match">:syn-ext-match</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a character with no special meaning matches itself<br>
<br>
<a class="Identifier" href="pattern.html#/[]">/[]</a>&nbsp;&nbsp; []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\[]&nbsp;&nbsp;&nbsp;&nbsp; any character specified inside the []<br>
<a class="Identifier" href="pattern.html#/\%[]">/\%[]</a>&nbsp;\%[]&nbsp;&nbsp;&nbsp;&nbsp;\%[]&nbsp;&nbsp;&nbsp;&nbsp;a sequence of optionally matched atoms<br>
<br>
<a class="Identifier" href="pattern.html#/\c">/\c</a>&nbsp;&nbsp; \c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ignore case, do not use the&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;option<br>
<a class="Identifier" href="pattern.html#/\C">/\C</a>&nbsp;&nbsp; \C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match case, do not use the&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;option<br>
<a class="Identifier" href="pattern.html#/\Z">/\Z</a>&nbsp;&nbsp; \Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ignore differences in Unicode &quot;combining characters&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Useful when searching voweled Hebrew or Arabic text.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">magic&nbsp;&nbsp; nomagic&nbsp;&nbsp; matches</span><br>
<a class="Identifier" href="pattern.html#/\m">/\m</a>&nbsp;&nbsp; \m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;on for the following chars in the pattern<br>
<a class="Identifier" href="pattern.html#/\M">/\M</a>&nbsp;&nbsp; \M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;off for the following chars in the pattern<br>
<a class="Identifier" href="pattern.html#/\v">/\v</a>&nbsp;&nbsp; \v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the following chars in the pattern are &quot;very magic&quot;<br>
<a class="Identifier" href="pattern.html#/\V">/\V</a>&nbsp;&nbsp; \V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the following chars in the pattern are &quot;very nomagic&quot;<br>
<a class="Identifier" href="pattern.html#/\%#=">/\%#=</a>&nbsp;&nbsp; \%#=1&nbsp;&nbsp; \%#=1&nbsp;&nbsp; select regexp engine&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<br>
<a class="Identifier" href="pattern.html#/\%d">/\%d</a>&nbsp;&nbsp;\%d&nbsp;&nbsp;&nbsp;&nbsp; \%d&nbsp;&nbsp;&nbsp;&nbsp; match specified decimal character (eg \%d123)<br>
<a class="Identifier" href="pattern.html#/\%x">/\%x</a>&nbsp;&nbsp;\%x&nbsp;&nbsp;&nbsp;&nbsp; \%x&nbsp;&nbsp;&nbsp;&nbsp; match specified hex character (eg \%x2a)<br>
<a class="Identifier" href="pattern.html#/\%o">/\%o</a>&nbsp;&nbsp;\%o&nbsp;&nbsp;&nbsp;&nbsp; \%o&nbsp;&nbsp;&nbsp;&nbsp; match specified octal character (eg \%o040)<br>
<a class="Identifier" href="pattern.html#/\%u">/\%u</a>&nbsp;&nbsp;\%u&nbsp;&nbsp;&nbsp;&nbsp; \%u&nbsp;&nbsp;&nbsp;&nbsp; match specified multibyte character (eg \%u20ac)<br>
<a class="Identifier" href="pattern.html#/\%U">/\%U</a>&nbsp;&nbsp;\%U&nbsp;&nbsp;&nbsp;&nbsp; \%U&nbsp;&nbsp;&nbsp;&nbsp; match specified large multibyte character (eg<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\%U12345678)<br>
<a class="Identifier" href="pattern.html#/\%C">/\%C</a>&nbsp;&nbsp;\%C&nbsp;&nbsp;&nbsp;&nbsp; \%C&nbsp;&nbsp;&nbsp;&nbsp; match any composing characters<br>
<br>
<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
\&lt;\I\i*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or<br>
\&lt;\h\w*<br>
\&lt;[a-zA-Z_][a-zA-Z0-9_]*<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An identifier (e.g., in a C program).<br>
<br>
\(\.$\|\. \)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A period followed by&nbsp;<span class="Special">&lt;EOL&gt;</span>&nbsp;or a space.<br>
<br>
[.!?][])&quot;']*\($\|[ ]\)&nbsp;&nbsp;A search pattern that finds the end of a sentence,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with almost the same definition as the &quot;)&quot; command.<br>
<br>
cat\Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Both &quot;cat&quot; and &quot;càt&quot; (&quot;a&quot; followed by 0x0300)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does not match &quot;càt&quot; (character 0x00e0), even<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;though it may look the same.<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
5. Multi items&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#pattern-multi-items" name="pattern-multi-items">pattern-multi-items</a><br>
<br>
An atom can be followed by an indication of how many times the atom can be<br>
matched and in what way.&nbsp;&nbsp;This is called a multi.&nbsp;&nbsp;See&nbsp;<a class="Identifier" href="pattern.html#/multi">/multi</a>&nbsp;for an<br>
overview.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/star" name="/star">/star</a>&nbsp;<a class="Constant" href="pattern.html#/\star" name="/\star">/\star</a><br>
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (use \* when&nbsp;<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;is not set)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches 0 or more of the preceding atom, as many as possible.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;'nomagic'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;, &quot;a&quot;, &quot;aa&quot;, &quot;aaa&quot;, etc.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \.\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; anything, also an empty string, no end-of-line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\_.*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_.\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;everything up to the end of the buffer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\_.*END&nbsp;&nbsp;&nbsp;&nbsp;\_.\*END&nbsp;&nbsp;&nbsp;&nbsp; everything up to and including the last &quot;END&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the buffer<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exception: When &quot;*&quot; is used at the start of the pattern or just after<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;^&quot; it matches the star character.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Be aware that repeating &quot;\_.&quot; can match a lot of text and take a long<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time.&nbsp;&nbsp;For example, &quot;\_.*END&quot; matches all text from the current<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position to the last occurrence of &quot;END&quot; in the file.&nbsp;&nbsp;Since the &quot;*&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will match as many as possible, this first skips over all lines until<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the end of the file and then tries matching &quot;END&quot;, backing up one<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character at a time.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\+" name="/\+">/\+</a><br>
\+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches 1 or more of the preceding atom, as many as possible.&nbsp;<span class="Special">{not in</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^.\+$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any non-empty line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\s\+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;white space of at least one character<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\=" name="/\=">/\=</a><br>
\=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches 0 or 1 of the preceding atom, as many as possible.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;fo&quot; and &quot;foo&quot;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\?" name="/\?">/\?</a><br>
\?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just like \=.&nbsp;&nbsp;Cannot be used when searching backwards with the &quot;?&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command.&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\{" name="/\{">/\{</a>&nbsp;<a class="Constant" href="pattern.html#E60" name="E60">E60</a>&nbsp;<a class="Constant" href="pattern.html#E554" name="E554">E554</a>&nbsp;<a class="Constant" href="pattern.html#E870" name="E870">E870</a><br>
\<span class="Special">{n,m}</span>&nbsp;&nbsp;Matches n to m of the preceding atom, as many as possible<br>
\<span class="Special">{n}</span>&nbsp;&nbsp;&nbsp;&nbsp;Matches n of the preceding atom<br>
\<span class="Special">{n,}</span>&nbsp;&nbsp; Matches at least n of the preceding atom, as many as possible<br>
\<span class="Special">{,m}</span>&nbsp;&nbsp; Matches 0 to m of the preceding atom, as many as possible<br>
\{}&nbsp;&nbsp;&nbsp;&nbsp; Matches 0 or more of the preceding atom, as many as possible (like *)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\{-" name="/\{-">/\{-</a><br>
\<span class="Special">{-n,m}</span>&nbsp;matches n to m of the preceding atom, as few as possible<br>
\<span class="Special">{-n}</span>&nbsp;&nbsp; matches n of the preceding atom<br>
\<span class="Special">{-n,}</span>&nbsp;&nbsp;matches at least n of the preceding atom, as few as possible<br>
\<span class="Special">{-,m}</span>&nbsp;&nbsp;matches 0 to m of the preceding atom, as few as possible<br>
\<span class="Special">{-}</span>&nbsp;&nbsp;&nbsp;&nbsp;matches 0 or more of the preceding atom, as few as possible<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{Vi does not have any of these}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n and m are positive decimal numbers or zero<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#non-greedy" name="non-greedy">non-greedy</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If a &quot;-&quot; appears immediately after the &quot;{&quot;, then a shortest match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;first algorithm is used (see example below).&nbsp;&nbsp;In particular, &quot;\<span class="Special">{-}</span>&quot; is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the same as &quot;*&quot; but uses the shortest match first algorithm.&nbsp;&nbsp;BUT: A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match that starts earlier is preferred over a shorter match: &quot;a\<span class="Special">{-}</span>b&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches &quot;aaab&quot; in &quot;xaaab&quot;.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ab\<span class="Special">{2,3}</span>c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;abbc&quot; or &quot;abbbc&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a\<span class="Special">{5}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;aaaaa&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ab\<span class="Special">{2,}</span>c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;abbc&quot;, &quot;abbbc&quot;, &quot;abbbbc&quot;, etc.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ab\<span class="Special">{,3}</span>c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;ac&quot;, &quot;abc&quot;, &quot;abbc&quot; or &quot;abbbc&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[bc]\<span class="Special">{3}</span>d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;abbbd&quot;, &quot;abbcd&quot;, &quot;acbcd&quot;, &quot;acccd&quot;, etc.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a\(bc\)\<span class="Special">{1,2}</span>d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;abcd&quot; or &quot;abcbcd&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[bc]\<span class="Special">{-}</span>[cd]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;abc&quot; in &quot;abcd&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[bc]*[cd]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;abcd&quot; in &quot;abcd&quot;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The } may optionally be preceded with a backslash: \{n,m\}.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\@=" name="/\@=">/\@=</a><br>
\@=&nbsp;&nbsp;&nbsp;&nbsp; Matches the preceding atom with zero width.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;(?=pattern)&quot; in Perl.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\(bar\)\@=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;foo&quot; in &quot;foobar&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\(bar\)\@=foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/zero-width" name="/zero-width">/zero-width</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When using &quot;\@=&quot; (or &quot;^&quot;, &quot;$&quot;, &quot;\&lt;&quot;, &quot;\&gt;&quot;) no characters are included<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the match.&nbsp;&nbsp;These items are only used to check if a match can be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;made.&nbsp;&nbsp;This can be tricky, because a match with following items will<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be done in the same position.&nbsp;&nbsp;The last example above will not match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;foobarfoo&quot;, because it tries match &quot;foo&quot; in the same position where<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;bar&quot; matched.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that using &quot;\&amp;&quot; works the same as using &quot;\@=&quot;: &quot;foo\&amp;..&quot; is the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same as &quot;\(foo\)\@=..&quot;.&nbsp;&nbsp;But using &quot;\&amp;&quot; is easier, you don't need the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;braces.<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\@!" name="/\@!">/\@!</a><br>
\@!&nbsp;&nbsp;&nbsp;&nbsp; Matches with zero width if the preceding atom does NOT match at the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current position.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;(?!pattern)&quot; in Perl.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\(bar\)\@!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any &quot;foo&quot; not followed by &quot;bar&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.\<span class="Special">{-}</span>p\@!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;a&quot;, &quot;ap&quot;, &quot;app&quot;, &quot;appp&quot;, etc. not immediately<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;followed by a &quot;p&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if \(\(then\)\@!.\)*$&nbsp;&nbsp; &quot;if &quot; not followed by &quot;then&quot;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Using &quot;\@!&quot; is tricky, because there are many places where a pattern<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;does not match.&nbsp;&nbsp;&quot;a.*p\@!&quot; will match from an &quot;a&quot; to the end of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line, because &quot;.*&quot; can match all characters in the line and the &quot;p&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doesn't match at the end of the line.&nbsp;&nbsp;&quot;a.\<span class="Special">{-}</span>p\@!&quot; will match any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;a&quot;, &quot;ap&quot;, &quot;app&quot;, etc. that isn't followed by a &quot;p&quot;, because the &quot;.&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can match a &quot;p&quot; and &quot;p\@!&quot; doesn't match after that.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You can't use &quot;\@!&quot; to look for a non-match before the matching<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: &quot;\(foo\)\@!bar&quot; will match &quot;bar&quot; in &quot;foobar&quot;, because at the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position where &quot;bar&quot; matches, &quot;foo&quot; does not match.&nbsp;&nbsp;To avoid matching<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;foobar&quot; you could use &quot;\(foo\)\@!...bar&quot;, but that doesn't match a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bar at the start of a line.&nbsp;&nbsp;Use &quot;\(foo\)\@&lt;!bar&quot;.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Useful example: to find &quot;foo&quot; in a line that does not contain &quot;bar&quot;:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^\%(.*bar\)\@!.*\zsfoo</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This pattern first checks that there is not a single position in the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line where &quot;bar&quot; matches.&nbsp;&nbsp;If &quot;.*bar&quot; matches somewhere the \@! will<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject the pattern.&nbsp;&nbsp;When there is no match any &quot;foo&quot; will be found.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The &quot;\zs&quot; is to have the match start just before &quot;foo&quot;.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\@<=" name="/\@&lt;=">/\@&lt;=</a><br>
\@&lt;=&nbsp;&nbsp;&nbsp;&nbsp;Matches with zero width if the preceding atom matches just before what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;follows.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;(?&lt;=pattern)&quot; in Perl, but Vim allows non-fixed-width patterns.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\(an\_s\+\)\@&lt;=file&nbsp;&nbsp;&nbsp;&nbsp; &quot;file&quot; after &quot;an&quot; and white space or an<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end-of-line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For speed it's often much better to avoid this multi.&nbsp;&nbsp;Try using &quot;\zs&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instead&nbsp;<a class="Identifier" href="pattern.html#/\zs">/\zs</a>.&nbsp;&nbsp;To match the same as the above example:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;an\_s\+\zsfile<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;At least set a limit for the look-behind, see below.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\@&lt;=&quot; and &quot;\@&lt;!&quot; check for matches just before what follows.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Theoretically these matches could start anywhere before this position.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;But to limit the time needed, only the line where what follows matches<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is searched, and one line before that (if there is one).&nbsp;&nbsp;This should<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be sufficient to match most things and not be too slow.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In the old regexp engine the part of the pattern after &quot;\@&lt;=&quot; and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\@&lt;!&quot; are checked for a match first, thus things like &quot;\1&quot; don't work<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to reference \(\) inside the preceding atom.&nbsp;&nbsp;It does work the other<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;way around:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Bad example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\%#=1\1\@&lt;=,\([a-z]\+\)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;,abc&quot; in &quot;abc,abc&quot;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;However, the new regexp engine works differently, it is better to not<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rely on this behavior, do not use \@&lt;= if it can be avoided:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\([a-z]\+\)\zs,\1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;,abc&quot; in &quot;abc,abc&quot;<br>
<br>
\@123&lt;=<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\@&lt;=&quot; but only look back 123 bytes. This avoids trying lots<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of matches that are known to fail and make executing the pattern very<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;slow.&nbsp;&nbsp;Example, check if there is a &quot;&lt;&quot; just before &quot;span&quot;:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&lt;\@1&lt;=span<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This will try matching &quot;&lt;&quot; only one byte before &quot;span&quot;, which is the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only place that works anyway.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After crossing a line boundary, the limit is relative to the end of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the line.&nbsp;&nbsp;Thus the characters at the start of the line with the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are not counted (this is just to keep it simple).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The number zero is the same as no limit.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\@<!" name="/\@&lt;!">/\@&lt;!</a><br>
\@&lt;!&nbsp;&nbsp;&nbsp;&nbsp;Matches with zero width if the preceding atom does NOT match just<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;before what follows.&nbsp;&nbsp;Thus this matches if there is no position in the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current or previous line where the atom matches such that it ends just<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;before what follows.&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;(?&lt;!pattern)&quot; in Perl, but Vim allows non-fixed-width patterns.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The match with the preceding atom is made to end just before the match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with what follows, thus an atom that ends in &quot;.*&quot; will work.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Warning: This can be slow (because many positions need to be checked<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for a match).&nbsp;&nbsp;Use a limit if you can, see below.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\(foo\)\@&lt;!bar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any &quot;bar&quot; that's not in &quot;foobar&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\(\/\/.*\)\@&lt;!in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;in&quot; which is not after &quot;//&quot;<br>
<br>
\@123&lt;!<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\@&lt;!&quot; but only look back 123 bytes. This avoids trying lots of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches that are known to fail and make executing the pattern very<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;slow.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\@>" name="/\@&gt;">/\@&gt;</a><br>
\@&gt;&nbsp;&nbsp;&nbsp;&nbsp; Matches the preceding atom like matching a whole pattern.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;(?&gt;pattern)&quot; in Perl.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\(a*\)\@&gt;a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nothing (the &quot;a*&quot; takes all the &quot;a&quot;'s, there can't be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;another one following)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This matches the preceding atom as if it was a pattern by itself.&nbsp;&nbsp;If<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it doesn't match, there is no retry with shorter sub-matches or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anything.&nbsp;&nbsp;Observe this difference: &quot;a*b&quot; and &quot;a*ab&quot; both match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;aaab&quot;, but in the second case the &quot;a*&quot; matches only the first two<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;a&quot;s.&nbsp;&nbsp;&quot;\(a*\)\@&gt;ab&quot; will not match &quot;aaab&quot;, because the &quot;a*&quot; matches<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the &quot;aaa&quot; (as many &quot;a&quot;s as possible), thus the &quot;ab&quot; can't match.<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
6.&nbsp;&nbsp;Ordinary atoms&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#pattern-atoms" name="pattern-atoms">pattern-atoms</a><br>
<br>
An ordinary atom can be:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/^" name="/^">/^</a><br>
^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; At beginning of pattern or after &quot;\|&quot;, &quot;\(&quot;, &quot;\%(&quot; or &quot;\n&quot;: matches<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start-of-line; at other positions, matches literal '^'.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^beep(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the start of the C function &quot;beep&quot; (probably).<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\^" name="/\^">/\^</a><br>
\^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches literal '^'.&nbsp;&nbsp;Can be used at any position in the pattern.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_^" name="/\_^">/\_^</a><br>
\_^&nbsp;&nbsp;&nbsp;&nbsp; Matches start-of-line.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;&nbsp;Can be used at any position in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the pattern.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\_s*\_^foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;white space and blank lines and then &quot;foo&quot; at<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start-of-line<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/$" name="/$">/$</a><br>
$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; At end of pattern or in front of &quot;\|&quot;, &quot;\)&quot; or &quot;\n&quot; (<a class="Type" href="options.html#'magic'">'magic'</a>&nbsp;on):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches end-of-line&nbsp;<span class="Special">&lt;EOL&gt;</span>; at other positions, matches literal '$'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\$" name="/\$">/\$</a><br>
\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches literal '$'.&nbsp;&nbsp;Can be used at any position in the pattern.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_$" name="/\_$">/\_$</a><br>
\_$&nbsp;&nbsp;&nbsp;&nbsp; Matches end-of-line.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;&nbsp;Can be used at any position in the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pattern.&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that &quot;a\_$b&quot; never matches, since &quot;b&quot; cannot match an<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end-of-line.&nbsp;&nbsp;Use &quot;a\nb&quot; instead&nbsp;<a class="Identifier" href="pattern.html#/\n">/\n</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\_$\_s*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;foo&quot; at end-of-line and following white space and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blank lines<br>
<br>
.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (with&nbsp;<a class="Type" href="options.html#'nomagic'">'nomagic'</a>: \.)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/." name="/.">/.</a>&nbsp;<a class="Constant" href="pattern.html#/\." name="/\.">/\.</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches any single character, but not an end-of-line.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_." name="/\_.">/\_.</a><br>
\_.&nbsp;&nbsp;&nbsp;&nbsp; Matches any single character or end-of-line.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Careful: &quot;\_.*&quot; matches all text to the end of the buffer!<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\<" name="/\&lt;">/\&lt;</a><br>
\&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches the beginning of a word: The next char is the first char of a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word.&nbsp;&nbsp;The&nbsp;<a class="Type" href="options.html#'iskeyword'">'iskeyword'</a>&nbsp;option specifies what is a word character.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\>" name="/\&gt;">/\&gt;</a><br>
\&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches the end of a word: The previous char is the last char of a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word.&nbsp;&nbsp;The&nbsp;<a class="Type" href="options.html#'iskeyword'">'iskeyword'</a>&nbsp;option specifies what is a word character.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\zs" name="/\zs">/\zs</a><br>
\zs&nbsp;&nbsp;&nbsp;&nbsp; Matches at any position, and sets the start of the match there: The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next char is the first char of the whole match.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^\s*\zsif</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches an &quot;if&quot; at the start of a line, ignoring white space.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Can be used multiple times, the last one encountered in a matching<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;branch is used.&nbsp;&nbsp;Example:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\(.\{-}\zsFab\)\{3}</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Finds the third occurrence of &quot;Fab&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This cannot be followed by a multi.&nbsp;<a class="Constant" href="pattern.html#E888" name="E888">E888</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not in Vi}</span>&nbsp;<span class="Special">{not available when compiled without the&nbsp;</span><a class="Identifier" href="various.html#+syntax">+syntax</a><span class="Special">&nbsp;feature}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\ze" name="/\ze">/\ze</a><br>
\ze&nbsp;&nbsp;&nbsp;&nbsp; Matches at any position, and sets the end of the match there: The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;previous char is the last char of the whole match.&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Can be used multiple times, the last one encountered in a matching<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;branch is used.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example: &quot;end\ze\(if\|for\)&quot; matches the &quot;end&quot; in &quot;endif&quot; and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;endfor&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This cannot be followed by a multi.&nbsp;<a class="Identifier" href="pattern.html#E888">E888</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not in Vi}</span>&nbsp;<span class="Special">{not available when compiled without the&nbsp;</span><a class="Identifier" href="various.html#+syntax">+syntax</a><span class="Special">&nbsp;feature}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%^" name="/\%^">/\%^</a>&nbsp;<a class="Constant" href="pattern.html#start-of-file" name="start-of-file">start-of-file</a><br>
\%^&nbsp;&nbsp;&nbsp;&nbsp; Matches start of the file.&nbsp;&nbsp;When matching with a string, matches the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start of the string.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For example, to find the first &quot;VIM&quot; in a file:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%^\_.\{-}\zsVIM</div>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%$" name="/\%$">/\%$</a>&nbsp;<a class="Constant" href="pattern.html#end-of-file" name="end-of-file">end-of-file</a><br>
\%$&nbsp;&nbsp;&nbsp;&nbsp; Matches end of the file.&nbsp;&nbsp;When matching with a string, matches the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end of the string.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that this does NOT find the last &quot;VIM&quot; in a file:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/VIM\_.\{-}\%$</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It will find the next VIM, because the part after it will always<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match.&nbsp;&nbsp;This one will find the last &quot;VIM&quot; in the file:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/VIM\ze\(\(VIM\)\@!\_.\)*\%$</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This uses&nbsp;<a class="Identifier" href="pattern.html#/\@!">/\@!</a>&nbsp;to ascertain that &quot;VIM&quot; does NOT match in any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position after the first &quot;VIM&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searching from the end of the file backwards is easier!<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%V" name="/\%V">/\%V</a><br>
\%V&nbsp;&nbsp;&nbsp;&nbsp; Match inside the Visual area.&nbsp;&nbsp;When Visual mode has already been<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stopped match in the area that&nbsp;<a class="Identifier" href="visual.html#gv">gv</a>&nbsp;would reselect.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is a&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;match.&nbsp;&nbsp;To make sure the whole pattern is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inside the Visual area put it at the start and just before the end of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the pattern, e.g.:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%Vfoo.*ba\%Vr</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This also works if only &quot;foo bar&quot; was Visually selected. This:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%Vfoo.*bar\%V</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; would match &quot;foo bar&quot; if the Visual selection continues after the &quot;r&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Only works for the current buffer.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%#" name="/\%#">/\%#</a>&nbsp;<a class="Constant" href="pattern.html#cursor-position" name="cursor-position">cursor-position</a><br>
\%#&nbsp;&nbsp;&nbsp;&nbsp; Matches with the cursor position.&nbsp;&nbsp;Only works when matching in a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buffer displayed in a window.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: When the cursor is moved after the pattern was used, the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result becomes invalid.&nbsp;&nbsp;Vim doesn't automatically update the matches.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is especially relevant for syntax highlighting and&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In other words: When the cursor moves the display isn't updated for<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this change.&nbsp;&nbsp;An update is done for lines which are changed (the whole<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line is updated) or when using the&nbsp;<a class="Identifier" href="various.html#CTRL-L">CTRL-L</a>&nbsp;command (the whole screen<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is updated).&nbsp;&nbsp;Example, to highlight the word under the cursor:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\k*\%#\k*</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;is set and you move the cursor around and make changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this will clearly show when the match is updated or not.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%'m" name="/\%'m">/\%'m</a>&nbsp;<a class="Constant" href="pattern.html#/\%<'m" name="/\%&lt;'m">/\%&lt;'m</a>&nbsp;<a class="Constant" href="pattern.html#/\%>'m" name="/\%&gt;'m">/\%&gt;'m</a><br>
\%'m&nbsp;&nbsp;&nbsp;&nbsp;Matches with the position of mark m.<br>
\%&lt;'m&nbsp;&nbsp; Matches before the position of mark m.<br>
\%&gt;'m&nbsp;&nbsp; Matches after the position of mark m.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example, to highlight the text from mark 's to 'e:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/.\%&gt;'s.*\%&lt;'e..</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that two dots are required to include mark 'e in the match.&nbsp;&nbsp;That<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is because &quot;\%&lt;'e&quot; matches at the character before the 'e mark, and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;since it's a&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;match it doesn't include that character.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: When the mark is moved after the pattern was used, the result<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;becomes invalid.&nbsp;&nbsp;Vim doesn't automatically update the matches.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Similar to moving the cursor for &quot;\%#&quot;&nbsp;<a class="Identifier" href="pattern.html#/\%#">/\%#</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%l" name="/\%l">/\%l</a>&nbsp;<a class="Constant" href="pattern.html#/\%>l" name="/\%&gt;l">/\%&gt;l</a>&nbsp;<a class="Constant" href="pattern.html#/\%<l" name="/\%&lt;l">/\%&lt;l</a><br>
\%23l&nbsp;&nbsp; Matches in a specific line.<br>
\%&lt;23l&nbsp;&nbsp;Matches above a specific line (lower line number).<br>
\%&gt;23l&nbsp;&nbsp;Matches below a specific line (higher line number).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;These three can be used to match specific lines in a buffer.&nbsp;&nbsp;The &quot;23&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can be any line number.&nbsp;&nbsp;The first line is 1.&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: When inserting or deleting lines Vim does not automatically<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update the matches.&nbsp;&nbsp;This means Syntax highlighting quickly becomes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wrong.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example, to highlight the line where the cursor currently is:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:exe '/\%' . line(&quot;.&quot;) . 'l.*'</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;is set and you move the cursor around and make changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this will clearly show when the match is updated or not.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%c" name="/\%c">/\%c</a>&nbsp;<a class="Constant" href="pattern.html#/\%>c" name="/\%&gt;c">/\%&gt;c</a>&nbsp;<a class="Constant" href="pattern.html#/\%<c" name="/\%&lt;c">/\%&lt;c</a><br>
\%23c&nbsp;&nbsp; Matches in a specific column.<br>
\%&lt;23c&nbsp;&nbsp;Matches before a specific column.<br>
\%&gt;23c&nbsp;&nbsp;Matches after a specific column.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;These three can be used to match specific columns in a buffer or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string.&nbsp;&nbsp;The &quot;23&quot; can be any column number.&nbsp;&nbsp;The first column is 1.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Actually, the column is the byte number (thus it's not exactly right<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for multi-byte characters).&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: When inserting or deleting text Vim does not automatically<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update the matches.&nbsp;&nbsp;This means Syntax highlighting quickly becomes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wrong.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example, to highlight the column where the cursor currently is:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:exe '/\%' . col(&quot;.&quot;) . 'c'</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;is set and you move the cursor around and make changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this will clearly show when the match is updated or not.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example for matching a single byte in column 44:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%&gt;43c.\%&lt;46c</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that &quot;\%&lt;46c&quot; matches in column 45 when the &quot;.&quot; matches a byte in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;column 44.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%v" name="/\%v">/\%v</a>&nbsp;<a class="Constant" href="pattern.html#/\%>v" name="/\%&gt;v">/\%&gt;v</a>&nbsp;<a class="Constant" href="pattern.html#/\%<v" name="/\%&lt;v">/\%&lt;v</a><br>
\%23v&nbsp;&nbsp; Matches in a specific virtual column.<br>
\%&lt;23v&nbsp;&nbsp;Matches before a specific virtual column.<br>
\%&gt;23v&nbsp;&nbsp;Matches after a specific virtual column.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;These three can be used to match specific virtual columns in a buffer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or string.&nbsp;&nbsp;When not matching with a buffer in a window, the option<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values of the current window are used (e.g.,&nbsp;<a class="Type" href="options.html#'tabstop'">'tabstop'</a>).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The &quot;23&quot; can be any column number.&nbsp;&nbsp;The first column is 1.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that some virtual column positions will never match, because they<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are halfway through a tab or other character that occupies more than<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;one screen character.&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: When inserting or deleting text Vim does not automatically<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update highlighted matches.&nbsp;&nbsp;This means Syntax highlighting quickly<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;becomes wrong.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example, to highlight all the characters after virtual column 72:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\%&gt;72v.*</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;is set and you move the cursor around and make changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this will clearly show when the match is updated or not.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To match the text up to column 17:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^.*\%17v</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Column 17 is not included, because this is a&nbsp;<a class="Identifier" href="pattern.html#/zero-width">/zero-width</a>&nbsp;match. To<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include the column use:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^.*\%17v.</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This command does the same thing, but also matches when there is no<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character in column 17:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^.*\%&lt;18v.</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that without the &quot;^&quot; to anchor the match in the first column,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this will also highlight column 17:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/.*\%17v</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Column 17 is highlighted by&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;because there is another match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where &quot;.*&quot; matches zero characters.<br>
&lt;<br>
<br>
Character classes:&nbsp;<span class="Special">{not in Vi}</span><br>
\i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;identifier character (see&nbsp;<a class="Type" href="options.html#'isident'">'isident'</a>&nbsp;option)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\i" name="/\i">/\i</a><br>
\I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\i&quot;, but excluding digits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\I" name="/\I">/\I</a><br>
\k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keyword character (see&nbsp;<a class="Type" href="options.html#'iskeyword'">'iskeyword'</a>&nbsp;option)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\k" name="/\k">/\k</a><br>
\K&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\k&quot;, but excluding digits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\K" name="/\K">/\K</a><br>
\f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file name character (see&nbsp;<a class="Type" href="options.html#'isfname'">'isfname'</a>&nbsp;option)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\f" name="/\f">/\f</a><br>
\F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\f&quot;, but excluding digits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\F" name="/\F">/\F</a><br>
\p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printable character (see&nbsp;<a class="Type" href="options.html#'isprint'">'isprint'</a>&nbsp;option)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\p" name="/\p">/\p</a><br>
\P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like &quot;\p&quot;, but excluding digits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\P" name="/\P">/\P</a><br>
<br>
<span class="Todo">NOTE</span>: the above also work for multi-byte characters.&nbsp;&nbsp;The ones below only<br>
match ASCII characters, as indicated by the range.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#whitespace" name="whitespace">whitespace</a>&nbsp;<a class="Constant" href="pattern.html#white-space" name="white-space">white-space</a><br>
\s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whitespace character:&nbsp;<span class="Special">&lt;Space&gt;</span>&nbsp;and&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\s" name="/\s">/\s</a><br>
\S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-whitespace character; opposite of \s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\S" name="/\S">/\S</a><br>
\d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\d" name="/\d">/\d</a><br>
\D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\D" name="/\D">/\D</a><br>
\x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hex digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9A-Fa-f]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\x" name="/\x">/\x</a><br>
\X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-hex digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9A-Fa-f]</span>&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\X" name="/\X">/\X</a><br>
\o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;octal digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-7]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\o" name="/\o">/\o</a><br>
\O&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-octal digit:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-7]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\O" name="/\O">/\O</a><br>
\w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[0-9A-Za-z_]</span>&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\w" name="/\w">/\w</a><br>
\W&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^0-9A-Za-z_]</span>&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\W" name="/\W">/\W</a><br>
\h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head of word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Za-z_]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\h" name="/\h">/\h</a><br>
\H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-head of word character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Za-z_]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\H" name="/\H">/\H</a><br>
\a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alphabetic character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Za-z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\a" name="/\a">/\a</a><br>
\A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-alphabetic character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Za-z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\A" name="/\A">/\A</a><br>
\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lowercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[a-z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\l" name="/\l">/\l</a><br>
\L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-lowercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^a-z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\L" name="/\L">/\L</a><br>
\u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uppercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[A-Z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\u" name="/\u">/\u</a><br>
\U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-uppercase character:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[^A-Z]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\U" name="/\U">/\U</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">NOTE</span>: Using the atom is faster than the [] form.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">NOTE</span>:&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>, &quot;\c&quot; and &quot;\C&quot; are not used by character classes.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_" name="/\_">/\_</a>&nbsp;<a class="Constant" href="pattern.html#E63" name="E63">E63</a>&nbsp;<a class="Constant" href="pattern.html#/\_i" name="/\_i">/\_i</a>&nbsp;<a class="Constant" href="pattern.html#/\_I" name="/\_I">/\_I</a>&nbsp;<a class="Constant" href="pattern.html#/\_k" name="/\_k">/\_k</a>&nbsp;<a class="Constant" href="pattern.html#/\_K" name="/\_K">/\_K</a>&nbsp;<a class="Constant" href="pattern.html#/\_f" name="/\_f">/\_f</a>&nbsp;<a class="Constant" href="pattern.html#/\_F" name="/\_F">/\_F</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_p" name="/\_p">/\_p</a>&nbsp;<a class="Constant" href="pattern.html#/\_P" name="/\_P">/\_P</a>&nbsp;<a class="Constant" href="pattern.html#/\_s" name="/\_s">/\_s</a>&nbsp;<a class="Constant" href="pattern.html#/\_S" name="/\_S">/\_S</a>&nbsp;<a class="Constant" href="pattern.html#/\_d" name="/\_d">/\_d</a>&nbsp;<a class="Constant" href="pattern.html#/\_D" name="/\_D">/\_D</a>&nbsp;<a class="Constant" href="pattern.html#/\_x" name="/\_x">/\_x</a>&nbsp;<a class="Constant" href="pattern.html#/\_X" name="/\_X">/\_X</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_o" name="/\_o">/\_o</a>&nbsp;<a class="Constant" href="pattern.html#/\_O" name="/\_O">/\_O</a>&nbsp;<a class="Constant" href="pattern.html#/\_w" name="/\_w">/\_w</a>&nbsp;<a class="Constant" href="pattern.html#/\_W" name="/\_W">/\_W</a>&nbsp;<a class="Constant" href="pattern.html#/\_h" name="/\_h">/\_h</a>&nbsp;<a class="Constant" href="pattern.html#/\_H" name="/\_H">/\_H</a>&nbsp;<a class="Constant" href="pattern.html#/\_a" name="/\_a">/\_a</a>&nbsp;<a class="Constant" href="pattern.html#/\_A" name="/\_A">/\_A</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\_l" name="/\_l">/\_l</a>&nbsp;<a class="Constant" href="pattern.html#/\_L" name="/\_L">/\_L</a>&nbsp;<a class="Constant" href="pattern.html#/\_u" name="/\_u">/\_u</a>&nbsp;<a class="Constant" href="pattern.html#/\_U" name="/\_U">/\_U</a><br>
\_x&nbsp;&nbsp;&nbsp;&nbsp; Where &quot;x&quot; is any of the characters above: The character class with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end-of-line added<br>
(end of character classes)<br>
<br>
\e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\e" name="/\e">/\e</a><br>
\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\t" name="/\t">/\t</a><br>
\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches&nbsp;<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\r" name="/\r">/\r</a><br>
\b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches&nbsp;<span class="Special">&lt;BS&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\b" name="/\b">/\b</a><br>
\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches an end-of-line&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\n" name="/\n">/\n</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When matching in a string instead of buffer text a literal newline<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character is matched.<br>
<br>
~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches the last given substitute string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/~" name="/~">/~</a>&nbsp;<a class="Constant" href="pattern.html#/\~" name="/\~">/\~</a><br>
<br>
\(\)&nbsp;&nbsp;&nbsp;&nbsp;A pattern enclosed by escaped parentheses.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\(" name="/\(">/\(</a>&nbsp;<a class="Constant" href="pattern.html#/\(\)" name="/\(\)">/\(\)</a>&nbsp;<a class="Constant" href="pattern.html#/\)" name="/\)">/\)</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E.g., &quot;\(^a\)&quot; matches 'a' at the start of a line.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E51" name="E51">E51</a>&nbsp;<a class="Constant" href="pattern.html#E54" name="E54">E54</a>&nbsp;<a class="Constant" href="pattern.html#E55" name="E55">E55</a>&nbsp;<a class="Constant" href="pattern.html#E872" name="E872">E872</a>&nbsp;<a class="Constant" href="pattern.html#E873" name="E873">E873</a><br>
<br>
\1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches the same string that was matched by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\1" name="/\1">/\1</a>&nbsp;<a class="Constant" href="pattern.html#E65" name="E65">E65</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the first sub-expression in \( and \).&nbsp;<span class="Special">{not in Vi}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example: &quot;\([a-z]\).\1&quot; matches &quot;ata&quot;, &quot;ehe&quot;, &quot;tot&quot;, etc.<br>
\2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\1&quot;, but uses second sub-expression,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\2" name="/\2">/\2</a><br>
<span class="Statement">&nbsp;&nbsp; ...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a class="Constant" href="pattern.html#/\3" name="/\3">/\3</a><br>
\9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like &quot;\1&quot;, but uses ninth sub-expression.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\9" name="/\9">/\9</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>: The numbering of groups is done based on which &quot;\(&quot; comes first<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the pattern (going left to right), NOT based on what is matched<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;first.<br>
<br>
\%(\)&nbsp;&nbsp; A pattern enclosed by escaped parentheses.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%(\)" name="/\%(\)">/\%(\)</a>&nbsp;<a class="Constant" href="pattern.html#/\%(" name="/\%(">/\%(</a>&nbsp;<a class="Constant" href="pattern.html#E53" name="E53">E53</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just like \(\), but without counting it as a sub-expression.&nbsp;&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allows using more groups and it's a little bit faster.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not in Vi}</span><br>
<br>
x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A single character, with no special meaning, matches itself<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\" name="/\">/\</a>&nbsp;<a class="Constant" href="pattern.html#/\\" name="/\\">/\\</a><br>
\x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A backslash followed by a single character, with no special meaning,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is reserved for future expansions<br>
<br>
[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(with&nbsp;<a class="Type" href="options.html#'nomagic'">'nomagic'</a>: \[])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/[]" name="/[]">/[]</a>&nbsp;<a class="Constant" href="pattern.html#/\[]" name="/\[]">/\[]</a>&nbsp;<a class="Constant" href="pattern.html#/\_[]" name="/\_[]">/\_[]</a>&nbsp;<a class="Constant" href="pattern.html#/collection" name="/collection">/collection</a><br>
\_[]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A collection.&nbsp;&nbsp;This is a sequence of characters enclosed in brackets.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It matches any single character in the collection.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[xyz]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any 'x', 'y' or 'z'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">[a-zA-Z]</span>$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any alphabetic character at the end of a line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\c[a-z]$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[А-яЁё]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Russian alphabet (with utf-8 and cp1251)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/[\n]" name="/[\n]">/[\n]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With &quot;\_&quot; prepended the collection also includes the end-of-line.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The same can be done by including &quot;\n&quot; in the collection.&nbsp;&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end-of-line is also matched when the collection starts with &quot;^&quot;!&nbsp;&nbsp;Thus<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\_[^ab]&quot; matches the end-of-line and any character but &quot;a&quot; and &quot;b&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This makes it Vi compatible: Without the &quot;\_&quot; or &quot;\n&quot; the collection<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;does not match an end-of-line.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E769" name="E769">E769</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When the ']' is not there Vim will not give an error message but<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assume no collection is used.&nbsp;&nbsp;Useful to search for '['.&nbsp;&nbsp;However, you<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do get E769 for internal searching.&nbsp;&nbsp;And be aware that in a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Comment" href="change.html#:substitute">:substitute</a>&nbsp;command the whole command becomes the pattern.&nbsp;&nbsp;E.g.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;:s/[/x/&quot; searches for &quot;[/x&quot; and replaces it with nothing.&nbsp;&nbsp;It does<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not search for &quot;[&quot; and replaces it with &quot;x&quot;!<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#E944" name="E944">E944</a>&nbsp;<a class="Constant" href="pattern.html#E945" name="E945">E945</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If the sequence begins with &quot;^&quot;, it matches any single character NOT<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the collection: &quot;[^xyz]&quot; matches anything but 'x', 'y' and 'z'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If two characters in the sequence are separated by '-', this is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shorthand for the full list of ASCII characters between them.&nbsp;&nbsp;E.g.,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;[0-9]&quot; matches any decimal digit. If the starting character exceeds<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the ending character, e.g.&nbsp;<span class="Special">[c-a]</span>, E944 occurs. Non-ASCII characters<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can be used, but the character values must not be more than 256 apart<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the old regexp engine. For example, searching by [\u3000-\u4000]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- A character class expression is evaluated to the set of characters<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;belonging to that character class.&nbsp;&nbsp;The following character classes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are supported:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Func&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contents</span><br>
<a class="Constant" href="pattern.html#[:alnum:]" name="[:alnum:]">[:alnum:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:alnum:]&nbsp;&nbsp; isalnum&nbsp;&nbsp; ASCII letters and digits<br>
<a class="Constant" href="pattern.html#[:alpha:]" name="[:alpha:]">[:alpha:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:alpha:]&nbsp;&nbsp; isalpha&nbsp;&nbsp; ASCII letters<br>
<a class="Constant" href="pattern.html#[:blank:]" name="[:blank:]">[:blank:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:blank:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; space and tab<br>
<a class="Constant" href="pattern.html#[:cntrl:]" name="[:cntrl:]">[:cntrl:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:cntrl:]&nbsp;&nbsp; iscntrl&nbsp;&nbsp; ASCII control characters<br>
<a class="Constant" href="pattern.html#[:digit:]" name="[:digit:]">[:digit:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:digit:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; decimal digits '0' to '9'<br>
<a class="Constant" href="pattern.html#[:graph:]" name="[:graph:]">[:graph:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:graph:]&nbsp;&nbsp; isgraph&nbsp;&nbsp; ASCII printable characters excluding<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;space<br>
<a class="Constant" href="pattern.html#[:lower:]" name="[:lower:]">[:lower:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:lower:]&nbsp;&nbsp; (1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lowercase letters (all letters when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;is used)<br>
<a class="Constant" href="pattern.html#[:print:]" name="[:print:]">[:print:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:print:]&nbsp;&nbsp; (2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printable characters including space<br>
<a class="Constant" href="pattern.html#[:punct:]" name="[:punct:]">[:punct:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:punct:]&nbsp;&nbsp; ispunct&nbsp;&nbsp; ASCII punctuation characters<br>
<a class="Constant" href="pattern.html#[:space:]" name="[:space:]">[:space:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:space:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; whitespace characters: space, tab, CR,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NL, vertical tab, form feed<br>
<a class="Constant" href="pattern.html#[:upper:]" name="[:upper:]">[:upper:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:upper:]&nbsp;&nbsp; (3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uppercase letters (all letters when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;is used)<br>
<a class="Constant" href="pattern.html#[:xdigit:]" name="[:xdigit:]">[:xdigit:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:xdigit:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hexadecimal digits: 0-9, a-f, A-F<br>
<a class="Constant" href="pattern.html#[:return:]" name="[:return:]">[:return:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:return:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;<span class="Special">&lt;CR&gt;</span>&nbsp;character<br>
<a class="Constant" href="pattern.html#[:tab:]" name="[:tab:]">[:tab:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [:tab:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the&nbsp;<span class="Special">&lt;Tab&gt;</span>&nbsp;character<br>
<a class="Constant" href="pattern.html#[:escape:]" name="[:escape:]">[:escape:]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:escape:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;<span class="Special">&lt;Esc&gt;</span>&nbsp;character<br>
<a class="Constant" href="pattern.html#[:backspace:]" name="[:backspace:]">[:backspace:]</a>&nbsp;&nbsp; [:backspace:]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the&nbsp;<span class="Special">&lt;BS&gt;</span>&nbsp;character<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The brackets in character class expressions are additional to the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;brackets delimiting a collection.&nbsp;&nbsp;For example, the following is a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plausible pattern for a UNIX filename: &quot;[-./[:alnum:]_~]\+&quot; That is,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a list of at least one character, each of which is either '-', '.',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'/', alphabetic, numeric, '_' or '~'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;These items only work for 8-bit characters, except [:lower:] and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:upper:] also work for multi-byte characters when using the new<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regexp engine.&nbsp;&nbsp;See&nbsp;<a class="Identifier" href="pattern.html#two-engines">two-engines</a>.&nbsp;&nbsp;In the future these items may<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;work for multi-byte characters.&nbsp;&nbsp;For now, to get all &quot;alpha&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characters you can use: [[:lower:][:upper:]].<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The &quot;Func&quot; column shows what library function is used.&nbsp;&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;implementation depends on the system.&nbsp;&nbsp;Otherwise:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1) Uses islower() for ASCII and Vim builtin rules for other<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characters when built with the&nbsp;<a class="Identifier" href="various.html#+multi_byte">+multi_byte</a>&nbsp;feature.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(2) Uses Vim builtin rules<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(3) As with (1) but using isupper()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/[[=" name="/[[=">/[[=</a>&nbsp;<a class="Constant" href="pattern.html#[==]" name="[==]">[==]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- An equivalence class.&nbsp;&nbsp;This means that characters are matched that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;have almost the same meaning, e.g., when ignoring accents.&nbsp;&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only works for Unicode, latin1 and latin9.&nbsp;&nbsp;The form is:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[=a=]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/[[." name="/[[.">/[[.</a>&nbsp;<a class="Constant" href="pattern.html#[..]" name="[..]">[..]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- A collation element.&nbsp;&nbsp;This currently simply accepts a single<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character in the form:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[.a.]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\]" name="/\]">/\]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- To include a literal ']', '^', '-' or '\' in the collection, put a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;backslash before it: &quot;[xyz\]]&quot;, &quot;[\^xyz]&quot;, &quot;[xy\-z]&quot; and &quot;[xyz\\]&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span class="Todo">Note</span>: POSIX does not support the use of a backslash this way).&nbsp;&nbsp;For<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;']' you can also make it the first character (following a possible<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;^&quot;):&nbsp;&nbsp;&quot;[]xyz]&quot; or &quot;[^]xyz]&quot;&nbsp;<span class="Special">{not in Vi}</span>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For '-' you can also make it the first or last character: &quot;[-xyz]&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;[^-xyz]&quot; or &quot;[xyz-]&quot;.&nbsp;&nbsp;For '\' you can also let it be followed by<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any character that's not in &quot;^]-\bdertnoUux&quot;.&nbsp;&nbsp;&quot;[\xyz]&quot; matches '\',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'x', 'y' and 'z'.&nbsp;&nbsp;It's better to use &quot;\\&quot; though, future expansions<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;may use other characters after '\'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Omitting the trailing ] is not considered an error. &quot;[]&quot; works like<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;[]]&quot;, it matches the ']' character.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- The following translations are accepted when the 'l' flag is not<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;included in&nbsp;<a class="Type" href="options.html#'cpoptions'">'cpoptions'</a>&nbsp;<span class="Special">{not in Vi}</span>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Esc&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;Tab&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;CR&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;(NOT end-of-line!)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">&lt;BS&gt;</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line break, see above&nbsp;<a class="Identifier" href="pattern.html#/[\n]">/[\n]</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\d123&nbsp;&nbsp; decimal number of character<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\o40&nbsp;&nbsp;&nbsp;&nbsp;octal number of character up to 0377<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\x20&nbsp;&nbsp;&nbsp;&nbsp;hexadecimal number of character up to 0xff<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u20AC&nbsp;&nbsp;hex. number of multibyte character up to 0xffff<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\U1234&nbsp;&nbsp;hex. number of multibyte character up to 0xffffffff<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">NOTE</span>: The other backslash codes mentioned above do not work inside<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[]!<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Matching with a collection can be slow, because each character in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the text has to be compared with each character in the collection.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use one of the other atoms above when possible.&nbsp;&nbsp;Example: &quot;\d&quot; is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;much faster than &quot;[0-9]&quot; and matches the same characters.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%[]" name="/\%[]">/\%[]</a>&nbsp;<a class="Constant" href="pattern.html#E69" name="E69">E69</a>&nbsp;<a class="Constant" href="pattern.html#E70" name="E70">E70</a>&nbsp;<a class="Constant" href="pattern.html#E369" name="E369">E369</a><br>
\%[]&nbsp;&nbsp;&nbsp;&nbsp;A sequence of optionally matched atoms.&nbsp;&nbsp;This always matches.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It matches as much of the list of atoms it contains as possible.&nbsp;&nbsp;Thus<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it stops at the first atom that doesn't match.&nbsp;&nbsp;For example:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/r\%[ead]</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches &quot;r&quot;, &quot;re&quot;, &quot;rea&quot; or &quot;read&quot;.&nbsp;&nbsp;The longest that matches is used.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To match the Ex command &quot;function&quot;, where &quot;fu&quot; is required and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;nction&quot; is optional, this would work:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\&lt;fu\%[nction]\&gt;</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The end-of-word atom &quot;\&gt;&quot; is used to avoid matching &quot;fu&quot; in &quot;full&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It gets more complicated when the atoms are not ordinary characters.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You don't often have to use it, but it is possible.&nbsp;&nbsp;Example:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/\&lt;r\%[[eo]ad]\&gt;</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Matches the words &quot;r&quot;, &quot;re&quot;, &quot;ro&quot;, &quot;rea&quot;, &quot;roa&quot;, &quot;read&quot; and &quot;road&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There can be no \(\), \%(\) or \z(\) items inside the [] and \%[] does<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not nest.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To include a &quot;[&quot; use &quot;[[]&quot; and for &quot;]&quot; use []]&quot;, e.g.,:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/index\%[[[]0[]]]</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches &quot;index&quot; &quot;index[&quot;, &quot;index[0&quot; and &quot;index[0]&quot;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{not available when compiled without the&nbsp;</span><a class="Identifier" href="various.html#+syntax">+syntax</a><span class="Special">&nbsp;feature}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%d" name="/\%d">/\%d</a>&nbsp;<a class="Constant" href="pattern.html#/\%x" name="/\%x">/\%x</a>&nbsp;<a class="Constant" href="pattern.html#/\%o" name="/\%o">/\%o</a>&nbsp;<a class="Constant" href="pattern.html#/\%u" name="/\%u">/\%u</a>&nbsp;<a class="Constant" href="pattern.html#/\%U" name="/\%U">/\%U</a>&nbsp;<a class="Constant" href="pattern.html#E678" name="E678">E678</a><br>
<br>
\%d123&nbsp;&nbsp;Matches the character specified with a decimal number.&nbsp;&nbsp;Must be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;followed by a non-digit.<br>
\%o40&nbsp;&nbsp; Matches the character specified with an octal number up to 0377.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numbers below 040 must be followed by a non-octal digit or a non-digit.<br>
\%x2a&nbsp;&nbsp; Matches the character specified with up to two hexadecimal characters.<br>
\%u20AC Matches the character specified with up to four hexadecimal<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characters.<br>
\%U1234abcd&nbsp;&nbsp;&nbsp;&nbsp; Matches the character specified with up to eight hexadecimal<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characters.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
7. Ignoring case in a pattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/ignorecase" name="/ignorecase">/ignorecase</a><br>
<br>
If the&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;option is on, the case of normal letters is ignored.<br>
<a class="Type" href="options.html#'smartcase'">'smartcase'</a>&nbsp;can be set to ignore case when the pattern contains lowercase<br>
letters only.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\c" name="/\c">/\c</a>&nbsp;<a class="Constant" href="pattern.html#/\C" name="/\C">/\C</a><br>
When &quot;\c&quot; appears anywhere in the pattern, the whole pattern is handled like<br>
<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;is on.&nbsp;&nbsp;The actual value of&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;and&nbsp;<a class="Type" href="options.html#'smartcase'">'smartcase'</a>&nbsp;is<br>
ignored.&nbsp;&nbsp;&quot;\C&quot; does the opposite: Force matching case for the whole pattern.<br>
<span class="Special">{only Vim supports \c and \C}</span><br>
<span class="Todo">Note</span>&nbsp;that&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>, &quot;\c&quot; and &quot;\C&quot; are not used for the character classes.<br>
<br>
Examples:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">pattern&nbsp;&nbsp; 'ignorecase'&nbsp;&nbsp;'smartcase'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matches</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo Foo FOO<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo Foo FOO<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Foo<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\cfoo&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo Foo FOO<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo\C&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo<br>
<br>
Technical detail:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#NL-used-for-Nul" name="NL-used-for-Nul">NL-used-for-Nul</a><br>
<span class="Special">&lt;Nul&gt;</span>&nbsp;characters in the file are stored as&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;in memory.&nbsp;&nbsp;In the display<br>
they are shown as &quot;^@&quot;.&nbsp;&nbsp;The translation is done when reading and writing<br>
files.&nbsp;&nbsp;To match a&nbsp;<span class="Special">&lt;Nul&gt;</span>&nbsp;with a search pattern you can just enter&nbsp;<span class="Special">CTRL-@</span>&nbsp;or<br>
&quot;<span class="Special">CTRL-V</span>&nbsp;000&quot;.&nbsp;&nbsp;This is probably just what you expect.&nbsp;&nbsp;Internally the<br>
character is replaced with a&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;in the search pattern.&nbsp;&nbsp;What is unusual is<br>
that typing&nbsp;<span class="Special">CTRL-V</span>&nbsp;<span class="Special">CTRL-J</span>&nbsp;also inserts a&nbsp;<span class="Special">&lt;NL&gt;</span>, thus also searches for a&nbsp;<span class="Special">&lt;Nul&gt;</span><br>
in the file.&nbsp;&nbsp;<span class="Special">{Vi cannot handle &lt;Nul&gt; characters in the file at all}</span><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#CR-used-for-NL" name="CR-used-for-NL">CR-used-for-NL</a><br>
When&nbsp;<a class="Type" href="options.html#'fileformat'">'fileformat'</a>&nbsp;is &quot;mac&quot;,&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;characters in the file are stored as&nbsp;<span class="Special">&lt;CR&gt;</span><br>
characters internally.&nbsp;&nbsp;In the text they are shown as &quot;^J&quot;.&nbsp;&nbsp;Otherwise this<br>
works similar to the usage of&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;for a&nbsp;<span class="Special">&lt;Nul&gt;</span>.<br>
<br>
When working with expression evaluation, a&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;character in the pattern<br>
matches a&nbsp;<span class="Special">&lt;NL&gt;</span>&nbsp;in the string.&nbsp;&nbsp;The use of &quot;\n&quot; (backslash n) to match a&nbsp;<span class="Special">&lt;NL&gt;</span><br>
doesn't work there, it only works to match text in the buffer.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#pattern-multi-byte" name="pattern-multi-byte">pattern-multi-byte</a><br>
Patterns will also work with multi-byte characters, mostly as you would<br>
expect.&nbsp;&nbsp;But invalid bytes may cause trouble, a pattern with an invalid byte<br>
will probably never match.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
8. Composing characters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#patterns-composing" name="patterns-composing">patterns-composing</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\Z" name="/\Z">/\Z</a><br>
When &quot;\Z&quot; appears anywhere in the pattern, all composing characters are<br>
ignored.&nbsp;&nbsp;Thus only the base characters need to match, the composing<br>
characters may be different and the number of composing characters may differ.<br>
Only relevant when&nbsp;<a class="Type" href="options.html#'encoding'">'encoding'</a>&nbsp;is &quot;utf-8&quot;.<br>
Exception: If the pattern starts with one or more composing characters, these<br>
must match.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#/\%C" name="/\%C">/\%C</a><br>
Use &quot;\%C&quot; to skip any composing characters.&nbsp;&nbsp;For example, the pattern &quot;a&quot; does<br>
not match in &quot;càt&quot; (where the a has the composing character 0x0300), but<br>
&quot;a\%C&quot; does.&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that this does not match &quot;cát&quot; (where the á is character<br>
0xe1, it does not have a compositing character).&nbsp;&nbsp;It does match &quot;cat&quot; (where<br>
the a is just an a).<br>
<br>
When a composing character appears at the start of the pattern of after an<br>
item that doesn't include the composing character, a match is found at any<br>
character that includes this composing character.<br>
<br>
When using a dot and a composing character, this works the same as the<br>
composing character by itself, except that it doesn't matter what comes before<br>
this.<br>
<br>
The order of composing characters does not matter.&nbsp;&nbsp;Also, the text may have<br>
more composing characters than the pattern, it still matches.&nbsp;&nbsp;But all<br>
composing characters in the pattern must be found in the text.<br>
<br>
Suppose B is a base character and x and y are composing characters:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="PreProc">pattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes (perfect match)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes (order ignored)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; By&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no (x missing)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no (y missing)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes (perfect match)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no (x missing)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes (extra y ignored)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes (extra y ignored)<br>
<br>
<span class="PreProc">==============================================================================</span><br>
9. Compare with Perl patterns&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#perl-patterns" name="perl-patterns">perl-patterns</a><br>
<br>
Vim's regexes are most similar to Perl's, in terms of what you can do.&nbsp;&nbsp;The<br>
difference between them is mostly just notation;&nbsp;&nbsp;here's a summary of where<br>
they differ:<br>
<br>
<span class="PreProc">Capability&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in Vimspeak&nbsp;&nbsp;&nbsp;&nbsp; in Perlspeak</span><br>
<span class="PreProc">----------------------------------------------------------------</span><br>
force case insensitivity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(?i)<br>
force case sensitivity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(?-i)<br>
backref-less grouping&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \%(atom\)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (?:atom)<br>
conservative quantifiers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<span class="Special">{-n,m}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *?, +?, ??, {}?<br>
0-width match&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atom\@=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (?=atom)<br>
0-width non-match&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atom\@!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (?!atom)<br>
0-width preceding match&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atom\@&lt;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(?&lt;=atom)<br>
0-width preceding non-match&nbsp;&nbsp;&nbsp;&nbsp; atom\@&lt;!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(?&lt;!atom)<br>
match without retry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atom\@&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (?&gt;atom)<br>
<br>
Vim and Perl handle newline characters inside a string a bit differently:<br>
<br>
In Perl, ^ and $ only match at the very beginning and end of the text,<br>
by default, but you can set the 'm' flag, which lets them match at<br>
embedded newlines as well.&nbsp;&nbsp;You can also set the 's' flag, which causes<br>
a . to match newlines as well.&nbsp;&nbsp;(Both these flags can be changed inside<br>
a pattern using the same syntax used for the i flag above, BTW.)<br>
<br>
On the other hand, Vim's ^ and $ always match at embedded newlines, and<br>
you get two separate atoms, \%^ and \%$, which only match at the very<br>
start and end of the text, respectively.&nbsp;&nbsp;Vim solves the second problem<br>
by giving you the \_ &quot;modifier&quot;:&nbsp;&nbsp;put it in front of a . or a character<br>
class, and they will match newlines as well.<br>
<br>
Finally, these constructs are unique to Perl:<br>
- execution of arbitrary code in the regex:&nbsp;&nbsp;(?{perl code})<br>
- conditional expressions:&nbsp;&nbsp;(?(condition)true-expr|false-expr)<br>
<br>
...and these are unique to Vim&#0058;<br>
- changing the magic-ness of a pattern:&nbsp;&nbsp;\v \V \m \M<br>
&nbsp;&nbsp; (very useful for avoiding backslashitis)<br>
- sequence of optionally matching atoms:&nbsp;&nbsp;\%[atoms]<br>
- \&amp; (which is to \| what &quot;and&quot; is to &quot;or&quot;;&nbsp;&nbsp;it forces several branches<br>
&nbsp;&nbsp; to match at one spot)<br>
- matching lines/columns by number:&nbsp;&nbsp;\%5l \%5c \%5v<br>
- setting the start and end of the match:&nbsp;&nbsp;\zs \ze<br>
<br>
<span class="PreProc">==============================================================================</span><br>
10. Highlighting matches&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#match-highlight" name="match-highlight">match-highlight</a><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#:mat" name=":mat">:mat</a>&nbsp;<a class="Constant" href="pattern.html#:match" name=":match">:match</a><br>
:mat[ch]&nbsp;<span class="Special">{group}</span>&nbsp;/<span class="Special">{pattern}</span>/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Define a pattern to highlight in the current window.&nbsp;&nbsp;It will<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be highlighted with&nbsp;<span class="Special">{group}</span>.&nbsp;&nbsp;Example:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:highlight MyGroup ctermbg=green guibg=green<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:match MyGroup /TODO/</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Instead of // any character can be used to mark the start and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end of the&nbsp;<span class="Special">{pattern}</span>.&nbsp;&nbsp;Watch out for using special characters,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;such as '&quot;' and '|'.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">{group}</span>&nbsp;must exist at the moment this command is executed.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;<span class="Special">{group}</span>&nbsp;highlighting still applies when a character is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to be highlighted for&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>, as the highlighting for<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches is given higher priority than that of&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Syntax highlighting (see&nbsp;<a class="Type" href="options.html#'syntax'">'syntax'</a>) is also overruled by<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;that highlighting the last used search pattern with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'hlsearch'">'hlsearch'</a>&nbsp;is used in all windows, while the pattern defined<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with &quot;:match&quot; only exists in the current window.&nbsp;&nbsp;It is kept<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when switching to another buffer.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'ignorecase'">'ignorecase'</a>&nbsp;does not apply, use&nbsp;<a class="Identifier" href="pattern.html#/\c">/\c</a>&nbsp;in the pattern to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ignore case.&nbsp;&nbsp;Otherwise case is not ignored.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Type" href="options.html#'redrawtime'">'redrawtime'</a>&nbsp;defines the maximum time searched for pattern<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When matching end-of-line and Vim redraws only part of the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display you may get unexpected results.&nbsp;&nbsp;That is because Vim<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;looks for a match in the line where redrawing starts.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Also see&nbsp;<a class="Identifier" href="eval.html#matcharg()">matcharg()</a>&nbsp;and&nbsp;<a class="Identifier" href="eval.html#getmatches()">getmatches()</a>. The former returns<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the highlight group and pattern of a previous&nbsp;<a class="Identifier" href="pattern.html#:match">:match</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command.&nbsp;&nbsp;The latter returns a list with highlight groups and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;patterns defined by both&nbsp;<a class="Identifier" href="eval.html#matchadd()">matchadd()</a>&nbsp;and&nbsp;<a class="Identifier" href="pattern.html#:match">:match</a>.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Highlighting matches using&nbsp;<a class="Identifier" href="pattern.html#:match">:match</a>&nbsp;are limited to three<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches (aside from&nbsp;<a class="Identifier" href="pattern.html#:match">:match</a>,&nbsp;<a class="Identifier" href="pattern.html#:2match">:2match</a>&nbsp;and&nbsp;<a class="Identifier" href="pattern.html#:3match">:3match</a>&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available).&nbsp;<a class="Identifier" href="eval.html#matchadd()">matchadd()</a>&nbsp;does not have this limitation and in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;addition makes it possible to prioritize matches.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Another example, which highlights all characters in virtual<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;column 72 and more:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:highlight rightMargin term=bold ctermfg=blue guifg=blue<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:match rightMargin /.\%&gt;72v/</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To highlight all character that are in virtual column 7:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:highlight col8 ctermbg=grey guibg=grey<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:match col8 /\%&lt;8v.\%&gt;7v/</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Todo">Note</span>&nbsp;the use of two items to also match a character that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;occupies more than one virtual column, such as a TAB.<br>
<br>
:mat[ch]<br>
:mat[ch] none<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clear a previously defined match pattern.<br>
<br>
<br>
:2mat[ch]&nbsp;<span class="Special">{group}</span>&nbsp;/<span class="Special">{pattern}</span>/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#:2match" name=":2match">:2match</a><br>
:2mat[ch]<br>
:2mat[ch] none<br>
:3mat[ch]&nbsp;<span class="Special">{group}</span>&nbsp;/<span class="Special">{pattern}</span>/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="Constant" href="pattern.html#:3match" name=":3match">:3match</a><br>
:3mat[ch]<br>
:3mat[ch] none<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just like&nbsp;<a class="Identifier" href="pattern.html#:match">:match</a>&nbsp;above, but set a separate match.&nbsp;&nbsp;Thus<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;there can be three matches active at the same time.&nbsp;&nbsp;The match<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with the lowest number has priority if several match at the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same position.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The &quot;:3match&quot; command is used by the&nbsp;<a class="Identifier" href="pi_paren.html#matchparen">matchparen</a>&nbsp;plugin.&nbsp;&nbsp;You<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are suggested to use &quot;:match&quot; for manual matching and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;:2match&quot; for another plugin.<br>
<br>
<br>
&nbsp;vim:tw=78:ts=8:ft=help:norl:<br>
</div>

</article>

<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
  <span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>

<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->

</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
